Staging driver changes for 6.1-rc1
Here is the large set of staging driver changes for 6.1-rc1. Nothing really interesting in here at all except we deleted a driver (fwserial) as no one had been using it for a long time. Other than that, just the normal cleanups and minor fixes: - rtl8723bs driver cleanups - loads of r8188eu driver cleanups, making the driver smaller and fixing up some firmware dependency issues. - vt6655 driver cleanups. - lots of other small staging driver cleanups. All of these have been in linux-next for a while with no reported issues. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> -----BEGIN PGP SIGNATURE----- iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCY0GPBg8cZ3JlZ0Brcm9h aC5jb20ACgkQMUfUDdst+ynd8gCeJS+vq6paXc/p8nMfz82Q87pn3SAAoKtCLeKa k9ZtNB9ci3ws0E2mZFal =3CGs -----END PGP SIGNATURE----- Merge tag 'staging-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging Pull staging driver updates from Greg KH: "Here is the large set of staging driver changes for 6.1-rc1. Nothing really interesting in here at all except we deleted a driver (fwserial) as no one had been using it for a long time. Other than that, just the normal cleanups and minor fixes: - rtl8723bs driver cleanups - loads of r8188eu driver cleanups, making the driver smaller and fixing up some firmware dependency issues. - vt6655 driver cleanups. - lots of other small staging driver cleanups. All of these have been in linux-next for a while with no reported issues" * tag 'staging-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (266 commits) staging: rtl8192e: Rename variable Bandwidth to avoid CamelCase staging: r8188eu: remove PHY_RFConfig8188E() staging: r8188eu: remove PHY_RF6052_Config8188E() staging: r8188eu: convert ODM_ReadAndConfig_AGC_TAB_1T_8188E() to int staging: r8188eu: convert ODM_ReadAndConfig_PHY_REG_1T_8188E() to int staging: r8188eu: convert ODM_ReadAndConfig_RadioA_1T_8188E() to int staging: r8188eu: convert ODM_ReadAndConfig_MAC_REG_8188E() to int staging: rtl8192e: cmdpkt: Use skb_put_data() instead of skb_put/memcpy pair staging: r8188eu: Use skb_put_data() instead of skb_put/memcpy pair staging: r8188eu: remove hal/odm_RegConfig8188E.c staging: r8188eu: make odm_ConfigRF_RadioA_8188E() static staging: r8188eu: make odm_ConfigMAC_8188E() static staging: r8188eu: don't check for stop/removal in the blink worker staging: r8188eu: don't check bSurpriseRemoved in SwLedOff staging: rtl8192e: Remove unused variables ForcedAMSDUMaxSize, ... staging: rtl8192e: Rename CurrentMPDU..., ForcedAMPDU... and ForcedMPDU... staging: rtl8192e: Rename SelfMimoPs, CurrentOpMode and bForcedShortGI staging: rtl8192e: Rename PeerMimoPs, IOTAction and IOTRaFunc staging: rtl8192e: Rename RxRe...WinSize, RxReorder... and RxReorderDr... staging: rtl8192e: Rename szRT2RTAggBuffer, bRegRxRe... and bCurRxReo... ...
This commit is contained in:
commit
3002b7a318
|
@ -60,8 +60,6 @@ source "drivers/staging/board/Kconfig"
|
|||
|
||||
source "drivers/staging/gdm724x/Kconfig"
|
||||
|
||||
source "drivers/staging/fwserial/Kconfig"
|
||||
|
||||
source "drivers/staging/clocking-wizard/Kconfig"
|
||||
|
||||
source "drivers/staging/fbtft/Kconfig"
|
||||
|
|
|
@ -20,7 +20,6 @@ obj-$(CONFIG_USB_EMXX) += emxx_udc/
|
|||
obj-$(CONFIG_MFD_NVEC) += nvec/
|
||||
obj-$(CONFIG_STAGING_BOARD) += board/
|
||||
obj-$(CONFIG_LTE_GDM724X) += gdm724x/
|
||||
obj-$(CONFIG_FIREWIRE_SERIAL) += fwserial/
|
||||
obj-$(CONFIG_COMMON_CLK_XLNX_CLKWZRD) += clocking-wizard/
|
||||
obj-$(CONFIG_FB_TFT) += fbtft/
|
||||
obj-$(CONFIG_MOST) += most/
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
# SPDX-License-Identifier: GPL-2.0
|
||||
config FIREWIRE_SERIAL
|
||||
tristate "TTY over Firewire"
|
||||
depends on FIREWIRE && TTY
|
||||
help
|
||||
This enables TTY over IEEE 1394, providing high-speed serial
|
||||
connectivity to cabled peers. This driver implements a
|
||||
ad-hoc transport protocol and is currently limited to
|
||||
Linux-to-Linux communication.
|
||||
|
||||
To compile this driver as a module, say M here: the module will
|
||||
be called firewire-serial.
|
||||
|
||||
if FIREWIRE_SERIAL
|
||||
|
||||
config FWTTY_MAX_TOTAL_PORTS
|
||||
int "Maximum number of serial ports supported"
|
||||
default "64"
|
||||
help
|
||||
Set this to the maximum number of serial ports you want the
|
||||
firewire-serial driver to support.
|
||||
|
||||
config FWTTY_MAX_CARD_PORTS
|
||||
int "Maximum number of serial ports supported per adapter"
|
||||
range 0 FWTTY_MAX_TOTAL_PORTS
|
||||
default "32"
|
||||
help
|
||||
Set this to the maximum number of serial ports each firewire
|
||||
adapter supports. The actual number of serial ports registered
|
||||
is set with the module parameter "ttys".
|
||||
|
||||
endif
|
|
@ -1,3 +0,0 @@
|
|||
# SPDX-License-Identifier: GPL-2.0
|
||||
obj-$(CONFIG_FIREWIRE_SERIAL) += firewire-serial.o
|
||||
firewire-serial-objs := fwserial.o dma_fifo.o
|
|
@ -1,14 +0,0 @@
|
|||
TODOs prior to this driver moving out of staging
|
||||
------------------------------------------------
|
||||
1. Implement retries for RCODE_BUSY, RCODE_NO_ACK and RCODE_SEND_ERROR
|
||||
- I/O is handled asynchronously which presents some issues when error
|
||||
conditions occur.
|
||||
2. Implement _robust_ console on top of this. The existing prototype console
|
||||
driver is not ready for the big leagues yet.
|
||||
3. Expose means of controlling attach/detach of peers via sysfs. Include
|
||||
GUID-to-port matching/whitelist/blacklist.
|
||||
|
||||
-- Issues with firewire stack --
|
||||
1. This driver uses the same unregistered vendor id that the firewire core does
|
||||
(0xd00d1e). Perhaps this could be exposed as a define in
|
||||
firewire.h?
|
|
@ -1,294 +0,0 @@
|
|||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* DMA-able FIFO implementation
|
||||
*
|
||||
* Copyright (C) 2012 Peter Hurley <peter@hurleysoftware.com>
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/bug.h>
|
||||
|
||||
#include "dma_fifo.h"
|
||||
|
||||
#ifdef DEBUG_TRACING
|
||||
#define df_trace(s, args...) pr_debug(s, ##args)
|
||||
#else
|
||||
#define df_trace(s, args...)
|
||||
#endif
|
||||
|
||||
#define FAIL(fifo, condition, format...) ({ \
|
||||
fifo->corrupt = !!(condition); \
|
||||
WARN(fifo->corrupt, format); \
|
||||
})
|
||||
|
||||
/*
|
||||
* private helper fn to determine if check is in open interval (lo,hi)
|
||||
*/
|
||||
static bool addr_check(unsigned int check, unsigned int lo, unsigned int hi)
|
||||
{
|
||||
return check - (lo + 1) < (hi - 1) - lo;
|
||||
}
|
||||
|
||||
/**
|
||||
* dma_fifo_init: initialize the fifo to a valid but inoperative state
|
||||
* @fifo: address of in-place "struct dma_fifo" object
|
||||
*/
|
||||
void dma_fifo_init(struct dma_fifo *fifo)
|
||||
{
|
||||
memset(fifo, 0, sizeof(*fifo));
|
||||
INIT_LIST_HEAD(&fifo->pending);
|
||||
}
|
||||
|
||||
/**
|
||||
* dma_fifo_alloc - initialize and allocate dma_fifo
|
||||
* @fifo: address of in-place "struct dma_fifo" object
|
||||
* @size: 'apparent' size, in bytes, of fifo
|
||||
* @align: dma alignment to maintain (should be at least cpu cache alignment),
|
||||
* must be power of 2
|
||||
* @tx_limit: maximum # of bytes transmissible per dma (rounded down to
|
||||
* multiple of alignment, but at least align size)
|
||||
* @open_limit: maximum # of outstanding dma transactions allowed
|
||||
* @gfp_mask: get_free_pages mask, passed to kmalloc()
|
||||
*
|
||||
* The 'apparent' size will be rounded up to next greater aligned size.
|
||||
* Returns 0 if no error, otherwise an error code
|
||||
*/
|
||||
int dma_fifo_alloc(struct dma_fifo *fifo, int size, unsigned int align,
|
||||
int tx_limit, int open_limit, gfp_t gfp_mask)
|
||||
{
|
||||
int capacity;
|
||||
|
||||
if (!is_power_of_2(align) || size < 0)
|
||||
return -EINVAL;
|
||||
|
||||
size = round_up(size, align);
|
||||
capacity = size + align * open_limit + align * DMA_FIFO_GUARD;
|
||||
fifo->data = kmalloc(capacity, gfp_mask);
|
||||
if (!fifo->data)
|
||||
return -ENOMEM;
|
||||
|
||||
fifo->in = 0;
|
||||
fifo->out = 0;
|
||||
fifo->done = 0;
|
||||
fifo->size = size;
|
||||
fifo->avail = size;
|
||||
fifo->align = align;
|
||||
fifo->tx_limit = max_t(int, round_down(tx_limit, align), align);
|
||||
fifo->open = 0;
|
||||
fifo->open_limit = open_limit;
|
||||
fifo->guard = size + align * open_limit;
|
||||
fifo->capacity = capacity;
|
||||
fifo->corrupt = 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* dma_fifo_free - frees the fifo
|
||||
* @fifo: address of in-place "struct dma_fifo" to free
|
||||
*
|
||||
* Also reinits the fifo to a valid but inoperative state. This
|
||||
* allows the fifo to be reused with a different target requiring
|
||||
* different fifo parameters.
|
||||
*/
|
||||
void dma_fifo_free(struct dma_fifo *fifo)
|
||||
{
|
||||
struct dma_pending *pending, *next;
|
||||
|
||||
if (!fifo->data)
|
||||
return;
|
||||
|
||||
list_for_each_entry_safe(pending, next, &fifo->pending, link)
|
||||
list_del_init(&pending->link);
|
||||
kfree(fifo->data);
|
||||
fifo->data = NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* dma_fifo_reset - dumps the fifo contents and reinits for reuse
|
||||
* @fifo: address of in-place "struct dma_fifo" to reset
|
||||
*/
|
||||
void dma_fifo_reset(struct dma_fifo *fifo)
|
||||
{
|
||||
struct dma_pending *pending, *next;
|
||||
|
||||
if (!fifo->data)
|
||||
return;
|
||||
|
||||
list_for_each_entry_safe(pending, next, &fifo->pending, link)
|
||||
list_del_init(&pending->link);
|
||||
fifo->in = 0;
|
||||
fifo->out = 0;
|
||||
fifo->done = 0;
|
||||
fifo->avail = fifo->size;
|
||||
fifo->open = 0;
|
||||
fifo->corrupt = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* dma_fifo_in - copies data into the fifo
|
||||
* @fifo: address of in-place "struct dma_fifo" to write to
|
||||
* @src: buffer to copy from
|
||||
* @n: # of bytes to copy
|
||||
*
|
||||
* Returns the # of bytes actually copied, which can be less than requested if
|
||||
* the fifo becomes full. If < 0, return is error code.
|
||||
*/
|
||||
int dma_fifo_in(struct dma_fifo *fifo, const void *src, int n)
|
||||
{
|
||||
int ofs, l;
|
||||
|
||||
if (!fifo->data)
|
||||
return -ENOENT;
|
||||
if (fifo->corrupt)
|
||||
return -ENXIO;
|
||||
|
||||
if (n > fifo->avail)
|
||||
n = fifo->avail;
|
||||
if (n <= 0)
|
||||
return 0;
|
||||
|
||||
ofs = fifo->in % fifo->capacity;
|
||||
l = min(n, fifo->capacity - ofs);
|
||||
memcpy(fifo->data + ofs, src, l);
|
||||
memcpy(fifo->data, src + l, n - l);
|
||||
|
||||
if (FAIL(fifo, addr_check(fifo->done, fifo->in, fifo->in + n) ||
|
||||
fifo->avail < n,
|
||||
"fifo corrupt: in:%u out:%u done:%u n:%d avail:%d",
|
||||
fifo->in, fifo->out, fifo->done, n, fifo->avail))
|
||||
return -ENXIO;
|
||||
|
||||
fifo->in += n;
|
||||
fifo->avail -= n;
|
||||
|
||||
df_trace("in:%u out:%u done:%u n:%d avail:%d", fifo->in, fifo->out,
|
||||
fifo->done, n, fifo->avail);
|
||||
|
||||
return n;
|
||||
}
|
||||
|
||||
/**
|
||||
* dma_fifo_out_pend - gets address/len of next avail read and marks as pended
|
||||
* @fifo: address of in-place "struct dma_fifo" to read from
|
||||
* @pended: address of structure to fill with read address/len
|
||||
* The data/len fields will be NULL/0 if no dma is pended.
|
||||
*
|
||||
* Returns the # of used bytes remaining in fifo (ie, if > 0, more data
|
||||
* remains in the fifo that was not pended). If < 0, return is error code.
|
||||
*/
|
||||
int dma_fifo_out_pend(struct dma_fifo *fifo, struct dma_pending *pended)
|
||||
{
|
||||
unsigned int len, n, ofs, l, limit;
|
||||
|
||||
if (!fifo->data)
|
||||
return -ENOENT;
|
||||
if (fifo->corrupt)
|
||||
return -ENXIO;
|
||||
|
||||
pended->len = 0;
|
||||
pended->data = NULL;
|
||||
pended->out = fifo->out;
|
||||
|
||||
len = fifo->in - fifo->out;
|
||||
if (!len)
|
||||
return -ENODATA;
|
||||
if (fifo->open == fifo->open_limit)
|
||||
return -EAGAIN;
|
||||
|
||||
n = len;
|
||||
ofs = fifo->out % fifo->capacity;
|
||||
l = fifo->capacity - ofs;
|
||||
limit = min_t(unsigned int, l, fifo->tx_limit);
|
||||
if (n > limit) {
|
||||
n = limit;
|
||||
fifo->out += limit;
|
||||
} else if (ofs + n > fifo->guard) {
|
||||
fifo->out += l;
|
||||
fifo->in = fifo->out;
|
||||
} else {
|
||||
fifo->out += round_up(n, fifo->align);
|
||||
fifo->in = fifo->out;
|
||||
}
|
||||
|
||||
df_trace("in: %u out: %u done: %u n: %d len: %u avail: %d", fifo->in,
|
||||
fifo->out, fifo->done, n, len, fifo->avail);
|
||||
|
||||
pended->len = n;
|
||||
pended->data = fifo->data + ofs;
|
||||
pended->next = fifo->out;
|
||||
list_add_tail(&pended->link, &fifo->pending);
|
||||
++fifo->open;
|
||||
|
||||
if (FAIL(fifo, fifo->open > fifo->open_limit,
|
||||
"past open limit:%d (limit:%d)",
|
||||
fifo->open, fifo->open_limit))
|
||||
return -ENXIO;
|
||||
if (FAIL(fifo, fifo->out & (fifo->align - 1),
|
||||
"fifo out unaligned:%u (align:%u)",
|
||||
fifo->out, fifo->align))
|
||||
return -ENXIO;
|
||||
|
||||
return len - n;
|
||||
}
|
||||
|
||||
/**
|
||||
* dma_fifo_out_complete - marks pended dma as completed
|
||||
* @fifo: address of in-place "struct dma_fifo" which was read from
|
||||
* @complete: address of structure for previously pended dma to mark completed
|
||||
*/
|
||||
int dma_fifo_out_complete(struct dma_fifo *fifo, struct dma_pending *complete)
|
||||
{
|
||||
struct dma_pending *pending, *next, *tmp;
|
||||
|
||||
if (!fifo->data)
|
||||
return -ENOENT;
|
||||
if (fifo->corrupt)
|
||||
return -ENXIO;
|
||||
if (list_empty(&fifo->pending) && fifo->open == 0)
|
||||
return -EINVAL;
|
||||
|
||||
if (FAIL(fifo, list_empty(&fifo->pending) != (fifo->open == 0),
|
||||
"pending list disagrees with open count:%d",
|
||||
fifo->open))
|
||||
return -ENXIO;
|
||||
|
||||
tmp = complete->data;
|
||||
*tmp = *complete;
|
||||
list_replace(&complete->link, &tmp->link);
|
||||
dp_mark_completed(tmp);
|
||||
|
||||
/* Only update the fifo in the original pended order */
|
||||
list_for_each_entry_safe(pending, next, &fifo->pending, link) {
|
||||
if (!dp_is_completed(pending)) {
|
||||
df_trace("still pending: saved out: %u len: %d",
|
||||
pending->out, pending->len);
|
||||
break;
|
||||
}
|
||||
|
||||
if (FAIL(fifo, pending->out != fifo->done ||
|
||||
addr_check(fifo->in, fifo->done, pending->next),
|
||||
"in:%u out:%u done:%u saved:%u next:%u",
|
||||
fifo->in, fifo->out, fifo->done, pending->out,
|
||||
pending->next))
|
||||
return -ENXIO;
|
||||
|
||||
list_del_init(&pending->link);
|
||||
fifo->done = pending->next;
|
||||
fifo->avail += pending->len;
|
||||
--fifo->open;
|
||||
|
||||
df_trace("in: %u out: %u done: %u len: %u avail: %d", fifo->in,
|
||||
fifo->out, fifo->done, pending->len, fifo->avail);
|
||||
}
|
||||
|
||||
if (FAIL(fifo, fifo->open < 0, "open dma:%d < 0", fifo->open))
|
||||
return -ENXIO;
|
||||
if (FAIL(fifo, fifo->avail > fifo->size, "fifo avail:%d > size:%d",
|
||||
fifo->avail, fifo->size))
|
||||
return -ENXIO;
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -1,117 +0,0 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* DMA-able FIFO interface
|
||||
*
|
||||
* Copyright (C) 2012 Peter Hurley <peter@hurleysoftware.com>
|
||||
*/
|
||||
|
||||
#ifndef _DMA_FIFO_H_
|
||||
#define _DMA_FIFO_H_
|
||||
|
||||
/**
|
||||
* The design basis for the DMA FIFO is to provide an output side that
|
||||
* complies with the streaming DMA API design that can be DMA'd from directly
|
||||
* (without additional copying), coupled with an input side that maintains a
|
||||
* logically consistent 'apparent' size (ie, bytes in + bytes avail is static
|
||||
* for the lifetime of the FIFO).
|
||||
*
|
||||
* DMA output transactions originate on a cache line boundary and can be
|
||||
* variably-sized. DMA output transactions can be retired out-of-order but
|
||||
* the FIFO will only advance the output in the original input sequence.
|
||||
* This means the FIFO will eventually stall if a transaction is never retired.
|
||||
*
|
||||
* Chunking the output side into cache line multiples means that some FIFO
|
||||
* memory is unused. For example, if all the avail input has been pended out,
|
||||
* then the in and out markers are re-aligned to the next cache line.
|
||||
* The maximum possible waste is
|
||||
* (cache line alignment - 1) * (max outstanding dma transactions)
|
||||
* This potential waste requires additional hidden capacity within the FIFO
|
||||
* to be able to accept input while the 'apparent' size has not been reached.
|
||||
*
|
||||
* Additional cache lines (ie, guard area) are used to minimize DMA
|
||||
* fragmentation when wrapping at the end of the FIFO. Input is allowed into the
|
||||
* guard area, but the in and out FIFO markers are wrapped when DMA is pended.
|
||||
*/
|
||||
|
||||
#define DMA_FIFO_GUARD 3 /* # of cache lines to reserve for the guard area */
|
||||
|
||||
struct dma_fifo {
|
||||
unsigned int in;
|
||||
unsigned int out; /* updated when dma is pended */
|
||||
unsigned int done; /* updated upon dma completion */
|
||||
struct {
|
||||
unsigned corrupt:1;
|
||||
};
|
||||
int size; /* 'apparent' size of fifo */
|
||||
int guard; /* ofs of guard area */
|
||||
int capacity; /* size + reserved */
|
||||
int avail; /* # of unused bytes in fifo */
|
||||
unsigned int align; /* must be power of 2 */
|
||||
int tx_limit; /* max # of bytes per dma transaction */
|
||||
int open_limit; /* max # of outstanding allowed */
|
||||
int open; /* # of outstanding dma transactions */
|
||||
struct list_head pending; /* fifo markers for outstanding dma */
|
||||
void *data;
|
||||
};
|
||||
|
||||
struct dma_pending {
|
||||
struct list_head link;
|
||||
void *data;
|
||||
unsigned int len;
|
||||
unsigned int next;
|
||||
unsigned int out;
|
||||
};
|
||||
|
||||
static inline void dp_mark_completed(struct dma_pending *dp)
|
||||
{
|
||||
dp->data += 1;
|
||||
}
|
||||
|
||||
static inline bool dp_is_completed(struct dma_pending *dp)
|
||||
{
|
||||
return (unsigned long)dp->data & 1UL;
|
||||
}
|
||||
|
||||
void dma_fifo_init(struct dma_fifo *fifo);
|
||||
int dma_fifo_alloc(struct dma_fifo *fifo, int size, unsigned int align,
|
||||
int tx_limit, int open_limit, gfp_t gfp_mask);
|
||||
void dma_fifo_free(struct dma_fifo *fifo);
|
||||
void dma_fifo_reset(struct dma_fifo *fifo);
|
||||
int dma_fifo_in(struct dma_fifo *fifo, const void *src, int n);
|
||||
int dma_fifo_out_pend(struct dma_fifo *fifo, struct dma_pending *pended);
|
||||
int dma_fifo_out_complete(struct dma_fifo *fifo,
|
||||
struct dma_pending *complete);
|
||||
|
||||
/* returns the # of used bytes in the fifo */
|
||||
static inline int dma_fifo_level(struct dma_fifo *fifo)
|
||||
{
|
||||
return fifo->size - fifo->avail;
|
||||
}
|
||||
|
||||
/* returns the # of bytes ready for output in the fifo */
|
||||
static inline int dma_fifo_out_level(struct dma_fifo *fifo)
|
||||
{
|
||||
return fifo->in - fifo->out;
|
||||
}
|
||||
|
||||
/* returns the # of unused bytes in the fifo */
|
||||
static inline int dma_fifo_avail(struct dma_fifo *fifo)
|
||||
{
|
||||
return fifo->avail;
|
||||
}
|
||||
|
||||
/* returns true if fifo has max # of outstanding dmas */
|
||||
static inline bool dma_fifo_busy(struct dma_fifo *fifo)
|
||||
{
|
||||
return fifo->open == fifo->open_limit;
|
||||
}
|
||||
|
||||
/* changes the max size of dma returned from dma_fifo_out_pend() */
|
||||
static inline int dma_fifo_change_tx_limit(struct dma_fifo *fifo, int tx_limit)
|
||||
{
|
||||
tx_limit = round_down(tx_limit, fifo->align);
|
||||
fifo->tx_limit = max_t(int, tx_limit, fifo->align);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* _DMA_FIFO_H_ */
|
File diff suppressed because it is too large
Load Diff
|
@ -1,359 +0,0 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#ifndef _FIREWIRE_FWSERIAL_H
|
||||
#define _FIREWIRE_FWSERIAL_H
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/tty.h>
|
||||
#include <linux/tty_driver.h>
|
||||
#include <linux/tty_flip.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/firewire.h>
|
||||
#include <linux/firewire-constants.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/rcupdate.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/serial.h>
|
||||
#include <linux/serial_reg.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/seq_file.h>
|
||||
#include <linux/debugfs.h>
|
||||
|
||||
#include "dma_fifo.h"
|
||||
|
||||
#ifdef FWTTY_PROFILING
|
||||
#define DISTRIBUTION_MAX_SIZE 8192
|
||||
#define DISTRIBUTION_MAX_INDEX (ilog2(DISTRIBUTION_MAX_SIZE) + 1)
|
||||
static inline void fwtty_profile_data(unsigned int stat[], unsigned int val)
|
||||
{
|
||||
int n = (val) ? min(ilog2(val) + 1, DISTRIBUTION_MAX_INDEX) : 0;
|
||||
++stat[n];
|
||||
}
|
||||
#else
|
||||
#define DISTRIBUTION_MAX_INDEX 0
|
||||
#define fwtty_profile_data(st, n)
|
||||
#endif
|
||||
|
||||
/* Parameters for both VIRT_CABLE_PLUG & VIRT_CABLE_PLUG_RSP mgmt codes */
|
||||
struct virt_plug_params {
|
||||
__be32 status_hi;
|
||||
__be32 status_lo;
|
||||
__be32 fifo_hi;
|
||||
__be32 fifo_lo;
|
||||
__be32 fifo_len;
|
||||
};
|
||||
|
||||
struct peer_work_params {
|
||||
union {
|
||||
struct virt_plug_params plug_req;
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* fwtty_peer: structure representing local & remote unit devices
|
||||
* @unit: unit child device of fw_device node
|
||||
* @serial: back pointer to associated fw_serial aggregate
|
||||
* @guid: unique 64-bit guid for this unit device
|
||||
* @generation: most recent bus generation
|
||||
* @node_id: most recent node_id
|
||||
* @speed: link speed of peer (0 = S100, 2 = S400, ... 5 = S3200)
|
||||
* @mgmt_addr: bus addr region to write mgmt packets to
|
||||
* @status_addr: bus addr register to write line status to
|
||||
* @fifo_addr: bus addr region to write serial output to
|
||||
* @fifo_len: max length for single write to fifo_addr
|
||||
* @list: link for insertion into fw_serial's peer_list
|
||||
* @rcu: for deferring peer reclamation
|
||||
* @lock: spinlock to synchonize changes to state & port fields
|
||||
* @work: only one work item can be queued at any one time
|
||||
* Note: pending work is canceled prior to removal, so this
|
||||
* peer is valid for at least the lifetime of the work function
|
||||
* @work_params: parameter block for work functions
|
||||
* @timer: timer for resetting peer state if remote request times out
|
||||
* @state: current state
|
||||
* @connect: work item for auto-connecting
|
||||
* @connect_retries: # of connections already attempted
|
||||
* @port: associated tty_port (usable if state == FWSC_ATTACHED)
|
||||
*/
|
||||
struct fwtty_peer {
|
||||
struct fw_unit *unit;
|
||||
struct fw_serial *serial;
|
||||
u64 guid;
|
||||
int generation;
|
||||
int node_id;
|
||||
unsigned int speed;
|
||||
int max_payload;
|
||||
u64 mgmt_addr;
|
||||
|
||||
/* these are usable only if state == FWSC_ATTACHED */
|
||||
u64 status_addr;
|
||||
u64 fifo_addr;
|
||||
int fifo_len;
|
||||
|
||||
struct list_head list;
|
||||
struct rcu_head rcu;
|
||||
|
||||
spinlock_t lock;
|
||||
work_func_t workfn;
|
||||
struct work_struct work;
|
||||
struct peer_work_params work_params;
|
||||
struct timer_list timer;
|
||||
int state;
|
||||
struct delayed_work connect;
|
||||
int connect_retries;
|
||||
|
||||
struct fwtty_port *port;
|
||||
};
|
||||
|
||||
#define to_peer(ptr, field) (container_of(ptr, struct fwtty_peer, field))
|
||||
|
||||
/* state values for fwtty_peer.state field */
|
||||
enum fwtty_peer_state {
|
||||
FWPS_GONE,
|
||||
FWPS_NOT_ATTACHED,
|
||||
FWPS_ATTACHED,
|
||||
FWPS_PLUG_PENDING,
|
||||
FWPS_PLUG_RESPONDING,
|
||||
FWPS_UNPLUG_PENDING,
|
||||
FWPS_UNPLUG_RESPONDING,
|
||||
|
||||
FWPS_NO_MGMT_ADDR = -1,
|
||||
};
|
||||
|
||||
#define CONNECT_RETRY_DELAY HZ
|
||||
#define MAX_CONNECT_RETRIES 10
|
||||
|
||||
/* must be holding peer lock for these state funclets */
|
||||
static inline void peer_set_state(struct fwtty_peer *peer, int new)
|
||||
{
|
||||
peer->state = new;
|
||||
}
|
||||
|
||||
static inline struct fwtty_port *peer_revert_state(struct fwtty_peer *peer)
|
||||
{
|
||||
struct fwtty_port *port = peer->port;
|
||||
|
||||
peer->port = NULL;
|
||||
peer_set_state(peer, FWPS_NOT_ATTACHED);
|
||||
return port;
|
||||
}
|
||||
|
||||
struct fwserial_mgmt_pkt {
|
||||
struct {
|
||||
__be16 len;
|
||||
__be16 code;
|
||||
} hdr;
|
||||
union {
|
||||
struct virt_plug_params plug_req;
|
||||
struct virt_plug_params plug_rsp;
|
||||
};
|
||||
} __packed;
|
||||
|
||||
/* fwserial_mgmt_packet codes */
|
||||
#define FWSC_RSP_OK 0x0000
|
||||
#define FWSC_RSP_NACK 0x8000
|
||||
#define FWSC_CODE_MASK 0x0fff
|
||||
|
||||
#define FWSC_VIRT_CABLE_PLUG 1
|
||||
#define FWSC_VIRT_CABLE_UNPLUG 2
|
||||
#define FWSC_VIRT_CABLE_PLUG_RSP 3
|
||||
#define FWSC_VIRT_CABLE_UNPLUG_RSP 4
|
||||
|
||||
/* 1 min. plug timeout -- suitable for userland authorization */
|
||||
#define VIRT_CABLE_PLUG_TIMEOUT (60 * HZ)
|
||||
|
||||
struct stats {
|
||||
unsigned int xchars;
|
||||
unsigned int dropped;
|
||||
unsigned int tx_stall;
|
||||
unsigned int fifo_errs;
|
||||
unsigned int sent;
|
||||
unsigned int lost;
|
||||
unsigned int throttled;
|
||||
unsigned int reads[DISTRIBUTION_MAX_INDEX + 1];
|
||||
unsigned int writes[DISTRIBUTION_MAX_INDEX + 1];
|
||||
unsigned int txns[DISTRIBUTION_MAX_INDEX + 1];
|
||||
unsigned int unthrottle[DISTRIBUTION_MAX_INDEX + 1];
|
||||
};
|
||||
|
||||
struct fwconsole_ops {
|
||||
void (*notify)(int code, void *data);
|
||||
void (*stats)(struct stats *stats, void *data);
|
||||
void (*proc_show)(struct seq_file *m, void *data);
|
||||
};
|
||||
|
||||
/* codes for console ops notify */
|
||||
#define FWCON_NOTIFY_ATTACH 1
|
||||
#define FWCON_NOTIFY_DETACH 2
|
||||
|
||||
/**
|
||||
* fwtty_port: structure used to track/represent underlying tty_port
|
||||
* @port: underlying tty_port
|
||||
* @device: tty device
|
||||
* @index: index into port_table for this particular port
|
||||
* note: minor = index + minor_start assigned by tty_alloc_driver()
|
||||
* @serial: back pointer to the containing fw_serial
|
||||
* @rx_handler: bus address handler for unique addr region used by remotes
|
||||
* to communicate with this port. Every port uses
|
||||
* fwtty_port_handler() for per port transactions.
|
||||
* @fwcon_ops: ops for attached fw_console (if any)
|
||||
* @con_data: private data for fw_console
|
||||
* @wait_tx: waitqueue for sleeping until writer/drain completes tx
|
||||
* @emit_breaks: delayed work responsible for generating breaks when the
|
||||
* break line status is active
|
||||
* @cps : characters per second computed from the termios settings
|
||||
* @break_last: timestamp in jiffies from last emit_breaks
|
||||
* @hangup: work responsible for HUPing when carrier is dropped/lost
|
||||
* @mstatus: loose virtualization of LSR/MSR
|
||||
* bits 15..0 correspond to TIOCM_* bits
|
||||
* bits 19..16 reserved for mctrl
|
||||
* bit 20 OOB_TX_THROTTLE
|
||||
* bits 23..21 reserved
|
||||
* bits 31..24 correspond to UART_LSR_* bits
|
||||
* @lock: spinlock for protecting concurrent access to fields below it
|
||||
* @mctrl: loose virtualization of MCR
|
||||
* bits 15..0 correspond to TIOCM_* bits
|
||||
* bit 16 OOB_RX_THROTTLE
|
||||
* bits 19..17 reserved
|
||||
* bits 31..20 reserved for mstatus
|
||||
* @drain: delayed work scheduled to ensure that writes are flushed.
|
||||
* The work can race with the writer but concurrent sending is
|
||||
* prevented with the IN_TX flag. Scheduled under lock to
|
||||
* limit scheduling when fifo has just been drained.
|
||||
* @tx_fifo: fifo used to store & block-up writes for dma to remote
|
||||
* @max_payload: max bytes transmissible per dma (based on peer's max_payload)
|
||||
* @status_mask: UART_LSR_* bitmask significant to rx (based on termios)
|
||||
* @ignore_mask: UART_LSR_* bitmask of states to ignore (also based on termios)
|
||||
* @break_ctl: if set, port is 'sending break' to remote
|
||||
* @write_only: self-explanatory
|
||||
* @overrun: previous rx was lost (partially or completely)
|
||||
* @loopback: if set, port is in loopback mode
|
||||
* @flags: atomic bit flags
|
||||
* bit 0: IN_TX - gate to allow only one cpu to send from the dma fifo
|
||||
* at a time.
|
||||
* bit 1: STOP_TX - force tx to exit while sending
|
||||
* @peer: rcu-pointer to associated fwtty_peer (if attached)
|
||||
* NULL if no peer attached
|
||||
* @icount: predefined statistics reported by the TIOCGICOUNT ioctl
|
||||
* @stats: additional statistics reported in /proc/tty/driver/firewire_serial
|
||||
*/
|
||||
struct fwtty_port {
|
||||
struct tty_port port;
|
||||
struct device *device;
|
||||
unsigned int index;
|
||||
struct fw_serial *serial;
|
||||
struct fw_address_handler rx_handler;
|
||||
|
||||
struct fwconsole_ops *fwcon_ops;
|
||||
void *con_data;
|
||||
|
||||
wait_queue_head_t wait_tx;
|
||||
struct delayed_work emit_breaks;
|
||||
unsigned int cps;
|
||||
unsigned long break_last;
|
||||
|
||||
struct work_struct hangup;
|
||||
|
||||
unsigned int mstatus;
|
||||
|
||||
spinlock_t lock;
|
||||
unsigned int mctrl;
|
||||
struct delayed_work drain;
|
||||
struct dma_fifo tx_fifo;
|
||||
int max_payload;
|
||||
unsigned int status_mask;
|
||||
unsigned int ignore_mask;
|
||||
unsigned int break_ctl:1,
|
||||
write_only:1,
|
||||
overrun:1,
|
||||
loopback:1;
|
||||
unsigned long flags;
|
||||
|
||||
struct fwtty_peer __rcu *peer;
|
||||
|
||||
struct async_icount icount;
|
||||
struct stats stats;
|
||||
};
|
||||
|
||||
#define to_port(ptr, field) (container_of(ptr, struct fwtty_port, field))
|
||||
|
||||
/* bit #s for flags field */
|
||||
#define IN_TX 0
|
||||
#define STOP_TX 1
|
||||
|
||||
/* bitmasks for special mctrl/mstatus bits */
|
||||
#define OOB_RX_THROTTLE 0x00010000
|
||||
#define MCTRL_RSRVD 0x000e0000
|
||||
#define OOB_TX_THROTTLE 0x00100000
|
||||
#define MSTATUS_RSRVD 0x00e00000
|
||||
|
||||
#define MCTRL_MASK (TIOCM_DTR | TIOCM_RTS | TIOCM_OUT1 | TIOCM_OUT2 | \
|
||||
TIOCM_LOOP | OOB_RX_THROTTLE | MCTRL_RSRVD)
|
||||
|
||||
/* XXX even every 1/50th secs. may be unnecessarily accurate */
|
||||
/* delay in jiffies between brk emits */
|
||||
#define FREQ_BREAKS (HZ / 50)
|
||||
|
||||
/* Ports are allocated in blocks of num_ports for each fw_card */
|
||||
#define MAX_CARD_PORTS CONFIG_FWTTY_MAX_CARD_PORTS
|
||||
#define MAX_TOTAL_PORTS CONFIG_FWTTY_MAX_TOTAL_PORTS
|
||||
|
||||
/* tuning parameters */
|
||||
#define FWTTY_PORT_TXFIFO_LEN 4096
|
||||
#define FWTTY_PORT_MAX_PEND_DMA 8 /* costs a cache line per pend */
|
||||
#define DRAIN_THRESHOLD 1024
|
||||
#define MAX_ASYNC_PAYLOAD 4096 /* ohci-defined limit */
|
||||
#define WRITER_MINIMUM 128
|
||||
/* TODO: how to set watermark to AR context size? see fwtty_rx() */
|
||||
#define HIGH_WATERMARK 32768 /* AR context is 32K */
|
||||
|
||||
/*
|
||||
* Size of bus addr region above 4GB used per port as the recv addr
|
||||
* - must be at least as big as the MAX_ASYNC_PAYLOAD
|
||||
*/
|
||||
#define FWTTY_PORT_RXFIFO_LEN MAX_ASYNC_PAYLOAD
|
||||
|
||||
/**
|
||||
* fw_serial: aggregate used to associate tty ports with specific fw_card
|
||||
* @card: fw_card associated with this fw_serial device (1:1 association)
|
||||
* @kref: reference-counted multi-port management allows delayed destroy
|
||||
* @self: local unit device as 'peer'. Not valid until local unit device
|
||||
* is enumerated.
|
||||
* @list: link for insertion into fwserial_list
|
||||
* @peer_list: list of local & remote unit devices attached to this card
|
||||
* @ports: fixed array of tty_ports provided by this serial device
|
||||
*/
|
||||
struct fw_serial {
|
||||
struct fw_card *card;
|
||||
struct kref kref;
|
||||
|
||||
struct dentry *debugfs;
|
||||
struct fwtty_peer *self;
|
||||
|
||||
struct list_head list;
|
||||
struct list_head peer_list;
|
||||
|
||||
struct fwtty_port *ports[MAX_CARD_PORTS];
|
||||
};
|
||||
|
||||
#define to_serial(ptr, field) (container_of(ptr, struct fw_serial, field))
|
||||
|
||||
#define TTY_DEV_NAME "fwtty" /* ttyFW was taken */
|
||||
static const char tty_dev_name[] = TTY_DEV_NAME;
|
||||
static const char loop_dev_name[] = "fwloop";
|
||||
|
||||
extern struct tty_driver *fwtty_driver;
|
||||
|
||||
/*
|
||||
* Returns the max send async payload size in bytes based on the unit device
|
||||
* link speed. Self-limiting asynchronous bandwidth (via reducing the payload)
|
||||
* is not necessary and does not work, because
|
||||
* 1) asynchronous traffic will absorb all available bandwidth (less that
|
||||
* being used for isochronous traffic)
|
||||
* 2) isochronous arbitration always wins.
|
||||
*/
|
||||
static inline int link_speed_to_max_payload(unsigned int speed)
|
||||
{
|
||||
/* Max async payload is 4096 - see IEEE 1394-2008 tables 6-4, 16-18 */
|
||||
return min(512 << speed, 4096);
|
||||
}
|
||||
|
||||
#endif /* _FIREWIRE_FWSERIAL_H */
|
|
@ -3,7 +3,6 @@
|
|||
* Greybus Audio Sound SoC helper APIs
|
||||
*/
|
||||
|
||||
#include <linux/debugfs.h>
|
||||
#include <sound/core.h>
|
||||
#include <sound/soc.h>
|
||||
#include <sound/soc-dapm.h>
|
||||
|
@ -116,10 +115,6 @@ int gbaudio_dapm_free_controls(struct snd_soc_dapm_context *dapm,
|
|||
{
|
||||
int i;
|
||||
struct snd_soc_dapm_widget *w, *tmp_w;
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
struct dentry *parent = dapm->debugfs_dapm;
|
||||
struct dentry *debugfs_w = NULL;
|
||||
#endif
|
||||
|
||||
mutex_lock(&dapm->card->dapm_mutex);
|
||||
for (i = 0; i < num; i++) {
|
||||
|
@ -139,12 +134,6 @@ int gbaudio_dapm_free_controls(struct snd_soc_dapm_context *dapm,
|
|||
continue;
|
||||
}
|
||||
widget++;
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
if (!parent)
|
||||
debugfs_w = debugfs_lookup(w->name, parent);
|
||||
debugfs_remove(debugfs_w);
|
||||
debugfs_w = NULL;
|
||||
#endif
|
||||
gbaudio_dapm_free_widget(w);
|
||||
}
|
||||
mutex_unlock(&dapm->card->dapm_mutex);
|
||||
|
|
|
@ -125,7 +125,7 @@ static void cvm_oct_free_tx_skbs(struct net_device *dev)
|
|||
*
|
||||
* Returns Always returns NETDEV_TX_OK
|
||||
*/
|
||||
int cvm_oct_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||
netdev_tx_t cvm_oct_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||
{
|
||||
union cvmx_pko_command_word0 pko_command;
|
||||
union cvmx_buf_ptr hw_buffer;
|
||||
|
@ -506,7 +506,7 @@ skip_xmit:
|
|||
* @dev: Device info structure
|
||||
* Returns Always returns zero
|
||||
*/
|
||||
int cvm_oct_xmit_pow(struct sk_buff *skb, struct net_device *dev)
|
||||
netdev_tx_t cvm_oct_xmit_pow(struct sk_buff *skb, struct net_device *dev)
|
||||
{
|
||||
struct octeon_ethernet *priv = netdev_priv(dev);
|
||||
void *packet_buffer;
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
* Copyright (c) 2003-2007 Cavium Networks
|
||||
*/
|
||||
|
||||
int cvm_oct_xmit(struct sk_buff *skb, struct net_device *dev);
|
||||
int cvm_oct_xmit_pow(struct sk_buff *skb, struct net_device *dev);
|
||||
netdev_tx_t cvm_oct_xmit(struct sk_buff *skb, struct net_device *dev);
|
||||
netdev_tx_t cvm_oct_xmit_pow(struct sk_buff *skb, struct net_device *dev);
|
||||
int cvm_oct_transmit_qos(struct net_device *dev, void *work_queue_entry,
|
||||
int do_free, int qos);
|
||||
void cvm_oct_tx_initialize(void);
|
||||
|
|
|
@ -1149,19 +1149,7 @@ out_unlock:
|
|||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int pi433_debugfs_regs_open(struct inode *inode, struct file *filp)
|
||||
{
|
||||
return single_open(filp, pi433_debugfs_regs_show, inode->i_private);
|
||||
}
|
||||
|
||||
static const struct file_operations debugfs_fops = {
|
||||
.llseek = seq_lseek,
|
||||
.open = pi433_debugfs_regs_open,
|
||||
.owner = THIS_MODULE,
|
||||
.read = seq_read,
|
||||
.release = single_release
|
||||
};
|
||||
DEFINE_SHOW_ATTRIBUTE(pi433_debugfs_regs);
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
|
@ -1320,7 +1308,7 @@ static int pi433_probe(struct spi_device *spi)
|
|||
|
||||
entry = debugfs_create_dir(dev_name(device->dev),
|
||||
debugfs_lookup(KBUILD_MODNAME, NULL));
|
||||
debugfs_create_file("regs", 0400, entry, device, &debugfs_fops);
|
||||
debugfs_create_file("regs", 0400, entry, device, &pi433_debugfs_regs_fops);
|
||||
|
||||
return 0;
|
||||
|
||||
|
|
|
@ -816,7 +816,7 @@ int rf69_write_fifo(struct spi_device *spi, u8 *buffer, unsigned int size)
|
|||
|
||||
if (size > FIFO_SIZE) {
|
||||
dev_dbg(&spi->dev,
|
||||
"read fifo: passed in buffer bigger then internal buffer\n");
|
||||
"write fifo: passed in buffer bigger then internal buffer\n");
|
||||
return -EMSGSIZE;
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,6 @@ r8188eu-y = \
|
|||
hal/hal_com.o \
|
||||
hal/odm.o \
|
||||
hal/odm_HWConfig.o \
|
||||
hal/odm_RegConfig8188E.o \
|
||||
hal/odm_RTL8188E.o \
|
||||
hal/rtl8188e_cmd.o \
|
||||
hal/rtl8188e_dm.o \
|
||||
|
@ -18,19 +17,14 @@ r8188eu-y = \
|
|||
hal/rtl8188e_phycfg.o \
|
||||
hal/rtl8188e_rf6052.o \
|
||||
hal/rtl8188e_rxdesc.o \
|
||||
hal/rtl8188e_xmit.o \
|
||||
hal/rtl8188eu_recv.o \
|
||||
hal/rtl8188eu_xmit.o \
|
||||
hal/usb_halinit.o \
|
||||
hal/usb_ops_linux.o \
|
||||
os_dep/ioctl_linux.o \
|
||||
os_dep/mlme_linux.o \
|
||||
os_dep/os_intfs.o \
|
||||
os_dep/osdep_service.o \
|
||||
os_dep/recv_linux.o \
|
||||
os_dep/usb_intf.o \
|
||||
os_dep/usb_ops_linux.o \
|
||||
os_dep/xmit_linux.o \
|
||||
core/rtw_ap.o \
|
||||
core/rtw_br_ext.o \
|
||||
core/rtw_cmd.o \
|
||||
|
|
|
@ -935,6 +935,48 @@ u8 bss_cap_update_on_sta_leave(struct adapter *padapter, struct sta_info *psta)
|
|||
return beacon_updated;
|
||||
}
|
||||
|
||||
void rtw_indicate_sta_assoc_event(struct adapter *padapter, struct sta_info *psta)
|
||||
{
|
||||
union iwreq_data wrqu;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
|
||||
if (!psta)
|
||||
return;
|
||||
|
||||
if (psta->aid > NUM_STA)
|
||||
return;
|
||||
|
||||
if (pstapriv->sta_aid[psta->aid - 1] != psta)
|
||||
return;
|
||||
|
||||
wrqu.addr.sa_family = ARPHRD_ETHER;
|
||||
|
||||
memcpy(wrqu.addr.sa_data, psta->hwaddr, ETH_ALEN);
|
||||
|
||||
wireless_send_event(padapter->pnetdev, IWEVREGISTERED, &wrqu, NULL);
|
||||
}
|
||||
|
||||
static void rtw_indicate_sta_disassoc_event(struct adapter *padapter, struct sta_info *psta)
|
||||
{
|
||||
union iwreq_data wrqu;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
|
||||
if (!psta)
|
||||
return;
|
||||
|
||||
if (psta->aid > NUM_STA)
|
||||
return;
|
||||
|
||||
if (pstapriv->sta_aid[psta->aid - 1] != psta)
|
||||
return;
|
||||
|
||||
wrqu.addr.sa_family = ARPHRD_ETHER;
|
||||
|
||||
memcpy(wrqu.addr.sa_data, psta->hwaddr, ETH_ALEN);
|
||||
|
||||
wireless_send_event(padapter->pnetdev, IWEVEXPIRED, &wrqu, NULL);
|
||||
}
|
||||
|
||||
u8 ap_free_sta(struct adapter *padapter, struct sta_info *psta,
|
||||
bool active, u16 reason)
|
||||
{
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
#include "../include/drv_types.h"
|
||||
#include "../include/rtw_br_ext.h"
|
||||
#include "../include/usb_osintf.h"
|
||||
#include "../include/recv_osdep.h"
|
||||
|
||||
#ifndef csum_ipv6_magic
|
||||
#include "../include/net/ip6_checksum.h"
|
||||
|
|
|
@ -5,8 +5,6 @@
|
|||
|
||||
#include "../include/osdep_service.h"
|
||||
#include "../include/drv_types.h"
|
||||
#include "../include/recv_osdep.h"
|
||||
#include "../include/mlme_osdep.h"
|
||||
#include "../include/rtw_br_ext.h"
|
||||
#include "../include/rtw_mlme_ext.h"
|
||||
#include "../include/rtl8188e_dm.h"
|
||||
|
@ -58,8 +56,6 @@ exit:
|
|||
|
||||
u32 rtw_init_cmd_priv(struct cmd_priv *pcmdpriv)
|
||||
{
|
||||
u32 res = _SUCCESS;
|
||||
|
||||
init_completion(&pcmdpriv->enqueue_cmd);
|
||||
/* sema_init(&(pcmdpriv->cmd_done_sema), 0); */
|
||||
init_completion(&pcmdpriv->start_cmd_thread);
|
||||
|
@ -74,27 +70,24 @@ u32 rtw_init_cmd_priv(struct cmd_priv *pcmdpriv)
|
|||
pcmdpriv->cmd_allocated_buf = kzalloc(MAX_CMDSZ + CMDBUFF_ALIGN_SZ,
|
||||
GFP_KERNEL);
|
||||
|
||||
if (!pcmdpriv->cmd_allocated_buf) {
|
||||
res = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
if (!pcmdpriv->cmd_allocated_buf)
|
||||
return _FAIL;
|
||||
|
||||
pcmdpriv->cmd_buf = pcmdpriv->cmd_allocated_buf + CMDBUFF_ALIGN_SZ - ((size_t)(pcmdpriv->cmd_allocated_buf) & (CMDBUFF_ALIGN_SZ - 1));
|
||||
|
||||
pcmdpriv->rsp_allocated_buf = kzalloc(MAX_RSPSZ + 4, GFP_KERNEL);
|
||||
|
||||
if (!pcmdpriv->rsp_allocated_buf) {
|
||||
res = _FAIL;
|
||||
goto exit;
|
||||
kfree(pcmdpriv->cmd_allocated_buf);
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
pcmdpriv->rsp_buf = pcmdpriv->rsp_allocated_buf + 4 - ((size_t)(pcmdpriv->rsp_allocated_buf) & 3);
|
||||
|
||||
pcmdpriv->cmd_done_cnt = 0;
|
||||
pcmdpriv->rsp_cnt = 0;
|
||||
exit:
|
||||
|
||||
return res;
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
u32 rtw_init_evt_priv(struct evt_priv *pevtpriv)
|
||||
|
@ -288,8 +281,7 @@ post_process:
|
|||
* ### NOTE:#### (!!!!)
|
||||
* MUST TAKE CARE THAT BEFORE CALLING THIS FUNC, YOU SHOULD HAVE LOCKED pmlmepriv->lock
|
||||
*/
|
||||
u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid, int ssid_num,
|
||||
struct rtw_ieee80211_channel *ch, int ch_num)
|
||||
u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid, int ssid_num)
|
||||
{
|
||||
u8 res = _FAIL;
|
||||
struct cmd_obj *ph2c;
|
||||
|
@ -331,17 +323,6 @@ u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid,
|
|||
}
|
||||
}
|
||||
|
||||
/* prepare channel list */
|
||||
if (ch) {
|
||||
int i;
|
||||
for (i = 0; i < ch_num && i < RTW_CHANNEL_SCAN_AMOUNT; i++) {
|
||||
if (ch[i].hw_value && !(ch[i].flags & RTW_IEEE80211_CHAN_DISABLED)) {
|
||||
memcpy(&psurveyPara->ch[i], &ch[i], sizeof(struct rtw_ieee80211_channel));
|
||||
psurveyPara->ch_num++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
set_fwstate(pmlmepriv, _FW_UNDER_SURVEY);
|
||||
|
||||
res = rtw_enqueue_cmd(pcmdpriv, ph2c);
|
||||
|
@ -1290,6 +1271,66 @@ exit:
|
|||
return res;
|
||||
}
|
||||
|
||||
/* C2H event format:
|
||||
* Field TRIGGER CONTENT CMD_SEQ CMD_LEN CMD_ID
|
||||
* BITS [127:120] [119:16] [15:8] [7:4] [3:0]
|
||||
*/
|
||||
static s32 c2h_evt_read(struct adapter *adapter, u8 *buf)
|
||||
{
|
||||
s32 ret = _FAIL;
|
||||
struct c2h_evt_hdr *c2h_evt;
|
||||
int i;
|
||||
u8 trigger;
|
||||
|
||||
if (!buf)
|
||||
goto exit;
|
||||
|
||||
ret = rtw_read8(adapter, REG_C2HEVT_CLEAR, &trigger);
|
||||
if (ret)
|
||||
return _FAIL;
|
||||
|
||||
if (trigger == C2H_EVT_HOST_CLOSE)
|
||||
goto exit; /* Not ready */
|
||||
else if (trigger != C2H_EVT_FW_CLOSE)
|
||||
goto clear_evt; /* Not a valid value */
|
||||
|
||||
c2h_evt = (struct c2h_evt_hdr *)buf;
|
||||
|
||||
memset(c2h_evt, 0, 16);
|
||||
|
||||
ret = rtw_read8(adapter, REG_C2HEVT_MSG_NORMAL, buf);
|
||||
if (ret) {
|
||||
ret = _FAIL;
|
||||
goto clear_evt;
|
||||
}
|
||||
|
||||
ret = rtw_read8(adapter, REG_C2HEVT_MSG_NORMAL + 1, buf + 1);
|
||||
if (ret) {
|
||||
ret = _FAIL;
|
||||
goto clear_evt;
|
||||
}
|
||||
/* Read the content */
|
||||
for (i = 0; i < c2h_evt->plen; i++) {
|
||||
ret = rtw_read8(adapter, REG_C2HEVT_MSG_NORMAL +
|
||||
sizeof(*c2h_evt) + i, c2h_evt->payload + i);
|
||||
if (ret) {
|
||||
ret = _FAIL;
|
||||
goto clear_evt;
|
||||
}
|
||||
}
|
||||
|
||||
ret = _SUCCESS;
|
||||
|
||||
clear_evt:
|
||||
/* Clear event to notify FW we have read the command.
|
||||
* If this field isn't clear, the FW won't update the next
|
||||
* command message.
|
||||
*/
|
||||
rtw_write8(adapter, REG_C2HEVT_CLEAR, C2H_EVT_HOST_CLOSE);
|
||||
exit:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void c2h_evt_hdl(struct adapter *adapter, struct c2h_evt_hdr *c2h_evt, c2h_id_filter filter)
|
||||
{
|
||||
u8 buf[16];
|
||||
|
|
|
@ -236,7 +236,7 @@ static int load_firmware(struct rt_firmware *rtfw, struct device *device)
|
|||
{
|
||||
int ret = _SUCCESS;
|
||||
const struct firmware *fw;
|
||||
const char *fw_name = "rtlwifi/rtl8188eufw.bin";
|
||||
const char *fw_name = FW_RTL8188EU;
|
||||
int err = request_firmware(&fw, fw_name, device);
|
||||
|
||||
if (err) {
|
||||
|
|
|
@ -11,8 +11,6 @@
|
|||
#include "../include/usb_osintf.h"
|
||||
#include "../include/usb_ops.h"
|
||||
|
||||
extern void indicate_wx_scan_complete_event(struct adapter *padapter);
|
||||
|
||||
u8 rtw_do_join(struct adapter *padapter)
|
||||
{
|
||||
struct list_head *plist, *phead;
|
||||
|
@ -43,7 +41,7 @@ u8 rtw_do_join(struct adapter *padapter)
|
|||
if (!pmlmepriv->LinkDetectInfo.bBusyTraffic ||
|
||||
pmlmepriv->to_roaming > 0) {
|
||||
/* submit site_survey_cmd */
|
||||
ret = rtw_sitesurvey_cmd(padapter, &pmlmepriv->assoc_ssid, 1, NULL, 0);
|
||||
ret = rtw_sitesurvey_cmd(padapter, &pmlmepriv->assoc_ssid, 1);
|
||||
if (ret != _SUCCESS)
|
||||
pmlmepriv->to_join = false;
|
||||
} else {
|
||||
|
@ -89,7 +87,7 @@ u8 rtw_do_join(struct adapter *padapter)
|
|||
/* we try to issue sitesurvey firstly */
|
||||
if (!pmlmepriv->LinkDetectInfo.bBusyTraffic ||
|
||||
pmlmepriv->to_roaming > 0) {
|
||||
ret = rtw_sitesurvey_cmd(padapter, &pmlmepriv->assoc_ssid, 1, NULL, 0);
|
||||
ret = rtw_sitesurvey_cmd(padapter, &pmlmepriv->assoc_ssid, 1);
|
||||
if (ret != _SUCCESS)
|
||||
pmlmepriv->to_join = false;
|
||||
} else {
|
||||
|
@ -353,14 +351,9 @@ u8 rtw_set_802_11_bssid_list_scan(struct adapter *padapter, struct ndis_802_11_s
|
|||
/* Scan or linking is in progress, do nothing. */
|
||||
res = true;
|
||||
} else {
|
||||
if (rtw_is_scan_deny(padapter)) {
|
||||
indicate_wx_scan_complete_event(padapter);
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
spin_lock_bh(&pmlmepriv->lock);
|
||||
|
||||
res = rtw_sitesurvey_cmd(padapter, pssid, ssid_max_num, NULL, 0);
|
||||
res = rtw_sitesurvey_cmd(padapter, pssid, ssid_max_num);
|
||||
|
||||
spin_unlock_bh(&pmlmepriv->lock);
|
||||
}
|
||||
|
|
|
@ -25,9 +25,7 @@ static void ResetLedStatus(struct led_priv *pLed)
|
|||
pLed->bLedWPSBlinkInProgress = false;
|
||||
|
||||
pLed->BlinkTimes = 0; /* Number of times to toggle led state for blinking. */
|
||||
pLed->BlinkingLedState = LED_UNKNOWN; /* Next state for blinking, either RTW_LED_ON or RTW_LED_OFF are. */
|
||||
|
||||
pLed->bLedNoLinkBlinkInProgress = false;
|
||||
pLed->bLedLinkBlinkInProgress = false;
|
||||
pLed->bLedScanBlinkInProgress = false;
|
||||
}
|
||||
|
@ -37,7 +35,7 @@ static void SwLedOn(struct adapter *padapter, struct led_priv *pLed)
|
|||
u8 LedCfg;
|
||||
int res;
|
||||
|
||||
if (padapter->bSurpriseRemoved || padapter->bDriverStopped)
|
||||
if (padapter->bDriverStopped)
|
||||
return;
|
||||
|
||||
res = rtw_read8(padapter, REG_LEDCFG2, &LedCfg);
|
||||
|
@ -53,7 +51,7 @@ static void SwLedOff(struct adapter *padapter, struct led_priv *pLed)
|
|||
u8 LedCfg;
|
||||
int res;
|
||||
|
||||
if (padapter->bSurpriseRemoved || padapter->bDriverStopped)
|
||||
if (padapter->bDriverStopped)
|
||||
goto exit;
|
||||
|
||||
res = rtw_read8(padapter, REG_LEDCFG2, &LedCfg);/* 0x4E */
|
||||
|
@ -79,41 +77,25 @@ static void blink_work(struct work_struct *work)
|
|||
struct adapter *padapter = pLed->padapter;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
|
||||
if ((padapter->bSurpriseRemoved) || (padapter->bDriverStopped))
|
||||
return;
|
||||
|
||||
if (padapter->pwrctrlpriv.rf_pwrstate != rf_on) {
|
||||
SwLedOff(padapter, pLed);
|
||||
ResetLedStatus(pLed);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Change LED according to BlinkingLedState specified. */
|
||||
if (pLed->BlinkingLedState == RTW_LED_ON)
|
||||
SwLedOn(padapter, pLed);
|
||||
else
|
||||
if (pLed->bLedOn)
|
||||
SwLedOff(padapter, pLed);
|
||||
else
|
||||
SwLedOn(padapter, pLed);
|
||||
|
||||
switch (pLed->CurrLedState) {
|
||||
case 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_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_BLINK_SCAN:
|
||||
if (pLed->bLedOn)
|
||||
pLed->BlinkingLedState = RTW_LED_OFF;
|
||||
else
|
||||
pLed->BlinkingLedState = RTW_LED_ON;
|
||||
pLed->BlinkTimes--;
|
||||
if (pLed->BlinkTimes == 0) {
|
||||
if (check_fwstate(pmlmepriv, _FW_LINKED)) {
|
||||
|
@ -121,7 +103,6 @@ static void blink_work(struct work_struct *work)
|
|||
pLed->CurrLedState = LED_BLINK_NORMAL;
|
||||
schedule_delayed_work(&pLed->blink_work, LED_BLINK_LINK_INTVL);
|
||||
} else {
|
||||
pLed->bLedNoLinkBlinkInProgress = true;
|
||||
pLed->CurrLedState = LED_BLINK_SLOWLY;
|
||||
schedule_delayed_work(&pLed->blink_work, LED_BLINK_NO_LINK_INTVL);
|
||||
}
|
||||
|
@ -131,10 +112,6 @@ static void blink_work(struct work_struct *work)
|
|||
}
|
||||
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) {
|
||||
if (check_fwstate(pmlmepriv, _FW_LINKED)) {
|
||||
|
@ -142,7 +119,6 @@ static void blink_work(struct work_struct *work)
|
|||
pLed->CurrLedState = LED_BLINK_NORMAL;
|
||||
schedule_delayed_work(&pLed->blink_work, LED_BLINK_LINK_INTVL);
|
||||
} else {
|
||||
pLed->bLedNoLinkBlinkInProgress = true;
|
||||
pLed->CurrLedState = LED_BLINK_SLOWLY;
|
||||
schedule_delayed_work(&pLed->blink_work, LED_BLINK_NO_LINK_INTVL);
|
||||
}
|
||||
|
@ -152,25 +128,16 @@ static void blink_work(struct work_struct *work)
|
|||
}
|
||||
break;
|
||||
case 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_BLINK_WPS_STOP: /* WPS success */
|
||||
if (pLed->BlinkingLedState != RTW_LED_ON) {
|
||||
if (!pLed->bLedOn) {
|
||||
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);
|
||||
|
||||
pLed->bLedWPSBlinkInProgress = false;
|
||||
} else {
|
||||
pLed->BlinkingLedState = RTW_LED_OFF;
|
||||
schedule_delayed_work(&pLed->blink_work, LED_BLINK_WPS_SUCESS_INTVL);
|
||||
}
|
||||
break;
|
||||
|
@ -217,192 +184,110 @@ void rtw_led_control(struct adapter *padapter, enum LED_CTL_MODE LedAction)
|
|||
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;
|
||||
}
|
||||
if (pLed->CurrLedState == LED_BLINK_SCAN || IS_LED_WPS_BLINKING(pLed))
|
||||
return;
|
||||
|
||||
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);
|
||||
}
|
||||
cancel_delayed_work(&pLed->blink_work);
|
||||
|
||||
pLed->bLedLinkBlinkInProgress = false;
|
||||
pLed->bLedBlinkInProgress = false;
|
||||
|
||||
pLed->CurrLedState = LED_BLINK_SLOWLY;
|
||||
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);
|
||||
}
|
||||
if (!pLed->bLedLinkBlinkInProgress)
|
||||
return;
|
||||
|
||||
if (pLed->CurrLedState == LED_BLINK_SCAN || IS_LED_WPS_BLINKING(pLed))
|
||||
return;
|
||||
|
||||
cancel_delayed_work(&pLed->blink_work);
|
||||
|
||||
pLed->bLedBlinkInProgress = false;
|
||||
pLed->bLedLinkBlinkInProgress = true;
|
||||
|
||||
pLed->CurrLedState = LED_BLINK_NORMAL;
|
||||
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);
|
||||
}
|
||||
if ((pmlmepriv->LinkDetectInfo.bBusyTraffic) && (check_fwstate(pmlmepriv, _FW_LINKED)))
|
||||
return;
|
||||
|
||||
if (pLed->bLedScanBlinkInProgress)
|
||||
return;
|
||||
|
||||
if (IS_LED_WPS_BLINKING(pLed))
|
||||
return;
|
||||
|
||||
cancel_delayed_work(&pLed->blink_work);
|
||||
|
||||
pLed->bLedLinkBlinkInProgress = false;
|
||||
pLed->bLedBlinkInProgress = false;
|
||||
pLed->bLedScanBlinkInProgress = true;
|
||||
|
||||
pLed->CurrLedState = LED_BLINK_SCAN;
|
||||
pLed->BlinkTimes = 24;
|
||||
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);
|
||||
}
|
||||
if (pLed->bLedBlinkInProgress)
|
||||
return;
|
||||
|
||||
if (pLed->CurrLedState == LED_BLINK_SCAN || IS_LED_WPS_BLINKING(pLed))
|
||||
return;
|
||||
|
||||
cancel_delayed_work(&pLed->blink_work);
|
||||
|
||||
pLed->bLedLinkBlinkInProgress = false;
|
||||
pLed->bLedBlinkInProgress = true;
|
||||
|
||||
pLed->CurrLedState = LED_BLINK_TXRX;
|
||||
pLed->BlinkTimes = 2;
|
||||
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);
|
||||
}
|
||||
if (pLed->bLedWPSBlinkInProgress)
|
||||
return;
|
||||
|
||||
cancel_delayed_work(&pLed->blink_work);
|
||||
|
||||
pLed->bLedLinkBlinkInProgress = false;
|
||||
pLed->bLedBlinkInProgress = false;
|
||||
pLed->bLedScanBlinkInProgress = false;
|
||||
pLed->bLedWPSBlinkInProgress = true;
|
||||
pLed->CurrLedState = LED_BLINK_WPS;
|
||||
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;
|
||||
cancel_delayed_work(&pLed->blink_work);
|
||||
|
||||
pLed->bLedLinkBlinkInProgress = false;
|
||||
pLed->bLedBlinkInProgress = false;
|
||||
pLed->bLedScanBlinkInProgress = false;
|
||||
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;
|
||||
cancel_delayed_work(&pLed->blink_work);
|
||||
pLed->bLedWPSBlinkInProgress = false;
|
||||
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;
|
||||
}
|
||||
pLed->bLedLinkBlinkInProgress = false;
|
||||
pLed->bLedBlinkInProgress = false;
|
||||
pLed->bLedWPSBlinkInProgress = false;
|
||||
pLed->bLedScanBlinkInProgress = false;
|
||||
cancel_delayed_work(&pLed->blink_work);
|
||||
SwLedOff(padapter, pLed);
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -5,10 +5,7 @@
|
|||
|
||||
#include "../include/osdep_service.h"
|
||||
#include "../include/drv_types.h"
|
||||
#include "../include/recv_osdep.h"
|
||||
#include "../include/xmit_osdep.h"
|
||||
#include "../include/hal_intf.h"
|
||||
#include "../include/mlme_osdep.h"
|
||||
#include "../include/sta_info.h"
|
||||
#include "../include/wifi.h"
|
||||
#include "../include/wlan_bssdef.h"
|
||||
|
@ -190,6 +187,37 @@ u8 *rtw_get_beacon_interval_from_ie(u8 *ie)
|
|||
return ie + 8;
|
||||
}
|
||||
|
||||
static void rtw_join_timeout_handler(struct timer_list *t)
|
||||
{
|
||||
struct adapter *adapter = from_timer(adapter, t, mlmepriv.assoc_timer);
|
||||
|
||||
_rtw_join_timeout_handler(adapter);
|
||||
}
|
||||
|
||||
static void _rtw_scan_timeout_handler(struct timer_list *t)
|
||||
{
|
||||
struct adapter *adapter = from_timer(adapter, t, mlmepriv.scan_to_timer);
|
||||
|
||||
rtw_scan_timeout_handler(adapter);
|
||||
}
|
||||
|
||||
static void _dynamic_check_timer_handlder(struct timer_list *t)
|
||||
{
|
||||
struct adapter *adapter = from_timer(adapter, t, mlmepriv.dynamic_chk_timer);
|
||||
|
||||
rtw_dynamic_check_timer_handlder(adapter);
|
||||
_set_timer(&adapter->mlmepriv.dynamic_chk_timer, 2000);
|
||||
}
|
||||
|
||||
static void rtw_init_mlme_timer(struct adapter *padapter)
|
||||
{
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
|
||||
timer_setup(&pmlmepriv->assoc_timer, rtw_join_timeout_handler, 0);
|
||||
timer_setup(&pmlmepriv->scan_to_timer, _rtw_scan_timeout_handler, 0);
|
||||
timer_setup(&pmlmepriv->dynamic_chk_timer, _dynamic_check_timer_handlder, 0);
|
||||
}
|
||||
|
||||
int rtw_init_mlme_priv(struct adapter *padapter)/* struct mlme_priv *pmlmepriv) */
|
||||
{
|
||||
int i;
|
||||
|
@ -235,8 +263,6 @@ int rtw_init_mlme_priv(struct adapter *padapter)/* struct mlme_priv *pmlmepriv)
|
|||
|
||||
/* allocate DMA-able/Non-Page memory for cmd_buf and rsp_buf */
|
||||
|
||||
rtw_clear_scan_deny(padapter);
|
||||
|
||||
rtw_init_mlme_timer(padapter);
|
||||
|
||||
exit:
|
||||
|
@ -641,6 +667,23 @@ exit:
|
|||
spin_unlock_bh(&pmlmepriv->lock);
|
||||
}
|
||||
|
||||
static void rtw_xmit_schedule(struct adapter *padapter)
|
||||
{
|
||||
struct xmit_priv *pxmitpriv;
|
||||
|
||||
if (!padapter)
|
||||
return;
|
||||
|
||||
pxmitpriv = &padapter->xmitpriv;
|
||||
|
||||
spin_lock_bh(&pxmitpriv->lock);
|
||||
|
||||
if (rtw_txframes_pending(padapter))
|
||||
tasklet_hi_schedule(&pxmitpriv->xmit_tasklet);
|
||||
|
||||
spin_unlock_bh(&pxmitpriv->lock);
|
||||
}
|
||||
|
||||
void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf)
|
||||
{
|
||||
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
|
||||
|
@ -697,7 +740,7 @@ void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf)
|
|||
} else {
|
||||
if (rtw_to_roaming(adapter) != 0) {
|
||||
if (--pmlmepriv->to_roaming == 0 ||
|
||||
rtw_sitesurvey_cmd(adapter, &pmlmepriv->assoc_ssid, 1, NULL, 0) != _SUCCESS) {
|
||||
rtw_sitesurvey_cmd(adapter, &pmlmepriv->assoc_ssid, 1) != _SUCCESS) {
|
||||
rtw_set_roaming(adapter, 0);
|
||||
rtw_free_assoc_resources(adapter, 1);
|
||||
rtw_indicate_disconnect(adapter);
|
||||
|
@ -719,7 +762,7 @@ void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf)
|
|||
if (check_fwstate(pmlmepriv, _FW_LINKED))
|
||||
p2p_ps_wk_cmd(adapter, P2P_PS_SCAN_DONE, 0);
|
||||
|
||||
rtw_os_xmit_schedule(adapter);
|
||||
rtw_xmit_schedule(adapter);
|
||||
}
|
||||
|
||||
static void free_scanqueue(struct mlme_priv *pmlmepriv)
|
||||
|
@ -795,6 +838,48 @@ void rtw_free_assoc_resources(struct adapter *adapter, int lock_scanned_queue)
|
|||
|
||||
}
|
||||
|
||||
static struct rt_pmkid_list backup_pmkid[NUM_PMKID_CACHE];
|
||||
|
||||
static void rtw_reset_securitypriv(struct adapter *adapter)
|
||||
{
|
||||
u8 backup_index;
|
||||
u8 backup_counter;
|
||||
u32 backup_time;
|
||||
|
||||
if (adapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X) {
|
||||
/* 802.1x */
|
||||
/* We have to backup the PMK information for WiFi PMK Caching test item. */
|
||||
/* Backup the btkip_countermeasure information. */
|
||||
/* When the countermeasure is trigger, the driver have to disconnect with AP for 60 seconds. */
|
||||
memcpy(&backup_pmkid[0], &adapter->securitypriv.PMKIDList[0], sizeof(struct rt_pmkid_list) * NUM_PMKID_CACHE);
|
||||
backup_index = adapter->securitypriv.PMKIDIndex;
|
||||
backup_counter = adapter->securitypriv.btkip_countermeasure;
|
||||
backup_time = adapter->securitypriv.btkip_countermeasure_time;
|
||||
memset((unsigned char *)&adapter->securitypriv, 0, sizeof(struct security_priv));
|
||||
|
||||
/* Restore the PMK information to securitypriv structure for the following connection. */
|
||||
memcpy(&adapter->securitypriv.PMKIDList[0],
|
||||
&backup_pmkid[0],
|
||||
sizeof(struct rt_pmkid_list) * NUM_PMKID_CACHE);
|
||||
adapter->securitypriv.PMKIDIndex = backup_index;
|
||||
adapter->securitypriv.btkip_countermeasure = backup_counter;
|
||||
adapter->securitypriv.btkip_countermeasure_time = backup_time;
|
||||
adapter->securitypriv.ndisauthtype = Ndis802_11AuthModeOpen;
|
||||
adapter->securitypriv.ndisencryptstatus = Ndis802_11WEPDisabled;
|
||||
} else {
|
||||
/* reset values in securitypriv */
|
||||
struct security_priv *psec_priv = &adapter->securitypriv;
|
||||
|
||||
psec_priv->dot11AuthAlgrthm = dot11AuthAlgrthm_Open; /* open system */
|
||||
psec_priv->dot11PrivacyAlgrthm = _NO_PRIVACY_;
|
||||
psec_priv->dot11PrivacyKeyIndex = 0;
|
||||
psec_priv->dot118021XGrpPrivacy = _NO_PRIVACY_;
|
||||
psec_priv->dot118021XGrpKeyid = 1;
|
||||
psec_priv->ndisauthtype = Ndis802_11AuthModeOpen;
|
||||
psec_priv->ndisencryptstatus = Ndis802_11WEPDisabled;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
*rtw_indicate_connect: the caller has to lock pmlmepriv->lock
|
||||
*/
|
||||
|
@ -809,12 +894,13 @@ void rtw_indicate_connect(struct adapter *padapter)
|
|||
|
||||
rtw_led_control(padapter, LED_CTL_LINK);
|
||||
|
||||
rtw_os_indicate_connect(padapter);
|
||||
rtw_indicate_wx_assoc_event(padapter);
|
||||
netif_carrier_on(padapter->pnetdev);
|
||||
if (padapter->pid[2] != 0)
|
||||
rtw_signal_process(padapter->pid[2], SIGALRM);
|
||||
}
|
||||
|
||||
pmlmepriv->to_roaming = 0;
|
||||
|
||||
rtw_set_scan_deny(padapter, 3000);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -831,11 +917,14 @@ void rtw_indicate_disconnect(struct adapter *padapter)
|
|||
|
||||
if (check_fwstate(&padapter->mlmepriv, _FW_LINKED) ||
|
||||
(pmlmepriv->to_roaming <= 0)) {
|
||||
rtw_os_indicate_disconnect(padapter);
|
||||
/* Do it first for tx broadcast pkt after disconnection issue! */
|
||||
netif_carrier_off(padapter->pnetdev);
|
||||
|
||||
rtw_indicate_wx_disassoc_event(padapter);
|
||||
rtw_reset_securitypriv(padapter);
|
||||
|
||||
_clr_fwstate_(pmlmepriv, _FW_LINKED);
|
||||
rtw_led_control(padapter, LED_CTL_NO_LINK);
|
||||
rtw_clear_scan_deny(padapter);
|
||||
}
|
||||
p2p_ps_wk_cmd(padapter, P2P_PS_DISABLE, 1);
|
||||
|
||||
|
@ -843,9 +932,9 @@ void rtw_indicate_disconnect(struct adapter *padapter)
|
|||
|
||||
}
|
||||
|
||||
inline void rtw_indicate_scan_done(struct adapter *padapter, bool aborted)
|
||||
inline void rtw_indicate_scan_done(struct adapter *padapter)
|
||||
{
|
||||
rtw_os_indicate_scan_done(padapter, aborted);
|
||||
indicate_wx_scan_complete_event(padapter);
|
||||
}
|
||||
|
||||
static struct sta_info *rtw_joinbss_update_stainfo(struct adapter *padapter, struct wlan_network *pnetwork)
|
||||
|
@ -1068,8 +1157,7 @@ void rtw_joinbss_event_callback(struct adapter *adapter, u8 *pbuf)
|
|||
|
||||
mlmeext_joinbss_event_callback(adapter, pnetwork->join_res);
|
||||
|
||||
rtw_os_xmit_schedule(adapter);
|
||||
|
||||
rtw_xmit_schedule(adapter);
|
||||
}
|
||||
|
||||
void rtw_set_max_rpt_macid(struct adapter *adapter, u8 macid)
|
||||
|
@ -1316,7 +1404,7 @@ void rtw_scan_timeout_handler (struct adapter *adapter)
|
|||
spin_lock_bh(&pmlmepriv->lock);
|
||||
_clr_fwstate_(pmlmepriv, _FW_UNDER_SURVEY);
|
||||
spin_unlock_bh(&pmlmepriv->lock);
|
||||
rtw_indicate_scan_done(adapter, true);
|
||||
rtw_indicate_scan_done(adapter);
|
||||
}
|
||||
|
||||
static void rtw_auto_scan_handler(struct adapter *padapter)
|
||||
|
@ -1442,10 +1530,6 @@ int rtw_select_and_join_from_scanned_queue(struct mlme_priv *pmlmepriv)
|
|||
pmlmepriv->pscanned = phead->next;
|
||||
while (phead != pmlmepriv->pscanned) {
|
||||
pnetwork = container_of(pmlmepriv->pscanned, struct wlan_network, list);
|
||||
if (!pnetwork) {
|
||||
ret = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
pmlmepriv->pscanned = pmlmepriv->pscanned->next;
|
||||
rtw_check_join_candidate(pmlmepriv, &candidate, pnetwork);
|
||||
}
|
||||
|
@ -1639,6 +1723,33 @@ static int rtw_append_pmkid(struct adapter *Adapter, int iEntry, u8 *ie, uint ie
|
|||
return ie_len;
|
||||
}
|
||||
|
||||
static void rtw_report_sec_ie(struct adapter *adapter, u8 authmode, u8 *sec_ie)
|
||||
{
|
||||
uint len;
|
||||
u8 *buff, *p, i;
|
||||
union iwreq_data wrqu;
|
||||
|
||||
buff = NULL;
|
||||
if (authmode == _WPA_IE_ID_) {
|
||||
buff = kzalloc(IW_CUSTOM_MAX, GFP_ATOMIC);
|
||||
if (!buff)
|
||||
return;
|
||||
p = buff;
|
||||
p += sprintf(p, "ASSOCINFO(ReqIEs =");
|
||||
len = sec_ie[1] + 2;
|
||||
len = (len < IW_CUSTOM_MAX) ? len : IW_CUSTOM_MAX;
|
||||
for (i = 0; i < len; i++)
|
||||
p += sprintf(p, "%02x", sec_ie[i]);
|
||||
p += sprintf(p, ")");
|
||||
memset(&wrqu, 0, sizeof(wrqu));
|
||||
wrqu.data.length = p - buff;
|
||||
wrqu.data.length = (wrqu.data.length < IW_CUSTOM_MAX) ?
|
||||
wrqu.data.length : IW_CUSTOM_MAX;
|
||||
wireless_send_event(adapter->pnetdev, IWEVCUSTOM, &wrqu, buff);
|
||||
kfree(buff);
|
||||
}
|
||||
}
|
||||
|
||||
int rtw_restruct_sec_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, uint in_len)
|
||||
{
|
||||
u8 authmode = 0;
|
||||
|
|
|
@ -9,8 +9,6 @@
|
|||
#include "../include/wifi.h"
|
||||
#include "../include/rtw_mlme_ext.h"
|
||||
#include "../include/wlan_bssdef.h"
|
||||
#include "../include/mlme_osdep.h"
|
||||
#include "../include/recv_osdep.h"
|
||||
#include "../include/rtl8188e_xmit.h"
|
||||
#include "../include/rtl8188e_dm.h"
|
||||
|
||||
|
@ -334,6 +332,28 @@ static u8 init_channel_set(struct adapter *padapter, u8 ChannelPlan, struct rt_c
|
|||
return chanset_size;
|
||||
}
|
||||
|
||||
static void _survey_timer_hdl(struct timer_list *t)
|
||||
{
|
||||
struct adapter *padapter = from_timer(padapter, t, mlmeextpriv.survey_timer);
|
||||
|
||||
survey_timer_hdl(padapter);
|
||||
}
|
||||
|
||||
static void _link_timer_hdl(struct timer_list *t)
|
||||
{
|
||||
struct adapter *padapter = from_timer(padapter, t, mlmeextpriv.link_timer);
|
||||
|
||||
link_timer_hdl(padapter);
|
||||
}
|
||||
|
||||
static void init_mlme_ext_timer(struct adapter *padapter)
|
||||
{
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
|
||||
timer_setup(&pmlmeext->survey_timer, _survey_timer_hdl, 0);
|
||||
timer_setup(&pmlmeext->link_timer, _link_timer_hdl, 0);
|
||||
}
|
||||
|
||||
void init_mlme_ext_priv(struct adapter *padapter)
|
||||
{
|
||||
struct registry_priv *pregistrypriv = &padapter->registrypriv;
|
||||
|
@ -910,6 +930,46 @@ authclnt_fail:
|
|||
return _FAIL;
|
||||
}
|
||||
|
||||
static void UpdateBrateTbl(u8 *mbrate)
|
||||
{
|
||||
u8 i;
|
||||
u8 rate;
|
||||
|
||||
/* 1M, 2M, 5.5M, 11M, 6M, 12M, 24M are mandatory. */
|
||||
for (i = 0; i < NDIS_802_11_LENGTH_RATES_EX; i++) {
|
||||
rate = mbrate[i] & 0x7f;
|
||||
switch (rate) {
|
||||
case IEEE80211_CCK_RATE_1MB:
|
||||
case IEEE80211_CCK_RATE_2MB:
|
||||
case IEEE80211_CCK_RATE_5MB:
|
||||
case IEEE80211_CCK_RATE_11MB:
|
||||
case IEEE80211_OFDM_RATE_6MB:
|
||||
case IEEE80211_OFDM_RATE_12MB:
|
||||
case IEEE80211_OFDM_RATE_24MB:
|
||||
mbrate[i] |= IEEE80211_BASIC_RATE_MASK;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void UpdateBrateTblForSoftAP(u8 *bssrateset, u32 bssratelen)
|
||||
{
|
||||
u8 i;
|
||||
u8 rate;
|
||||
|
||||
for (i = 0; i < bssratelen; i++) {
|
||||
rate = bssrateset[i] & 0x7f;
|
||||
switch (rate) {
|
||||
case IEEE80211_CCK_RATE_1MB:
|
||||
case IEEE80211_CCK_RATE_2MB:
|
||||
case IEEE80211_CCK_RATE_5MB:
|
||||
case IEEE80211_CCK_RATE_11MB:
|
||||
bssrateset[i] |= IEEE80211_BASIC_RATE_MASK;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int OnAssocReq(struct adapter *padapter, struct recv_frame *precv_frame)
|
||||
{
|
||||
u16 capab_info;
|
||||
|
@ -1320,9 +1380,9 @@ OnAssocReqFail:
|
|||
|
||||
unsigned int OnAssocRsp(struct adapter *padapter, struct recv_frame *precv_frame)
|
||||
{
|
||||
struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)precv_frame->rx_data;
|
||||
uint i;
|
||||
int res;
|
||||
unsigned short status;
|
||||
struct ndis_802_11_var_ie *pIE;
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
|
||||
|
@ -1331,7 +1391,7 @@ unsigned int OnAssocRsp(struct adapter *padapter, struct recv_frame *precv_frame
|
|||
uint pkt_len = precv_frame->len;
|
||||
|
||||
/* check A1 matches or not */
|
||||
if (memcmp(myid(&padapter->eeprompriv), get_da(pframe), ETH_ALEN))
|
||||
if (memcmp(myid(&padapter->eeprompriv), mgmt->da, ETH_ALEN))
|
||||
return _SUCCESS;
|
||||
|
||||
if (!(pmlmeinfo->state & (WIFI_FW_AUTH_SUCCESS | WIFI_FW_ASSOC_STATE)))
|
||||
|
@ -1342,28 +1402,24 @@ unsigned int OnAssocRsp(struct adapter *padapter, struct recv_frame *precv_frame
|
|||
|
||||
_cancel_timer_ex(&pmlmeext->link_timer);
|
||||
|
||||
/* status */
|
||||
status = le16_to_cpu(*(__le16 *)(pframe + WLAN_HDR_A3_LEN + 2));
|
||||
if (status > 0) {
|
||||
if (le16_to_cpu(mgmt->u.assoc_resp.status_code) > 0) {
|
||||
pmlmeinfo->state = WIFI_FW_NULL_STATE;
|
||||
res = -4;
|
||||
goto report_assoc_result;
|
||||
}
|
||||
|
||||
/* get capabilities */
|
||||
pmlmeinfo->capability = le16_to_cpu(*(__le16 *)(pframe + WLAN_HDR_A3_LEN));
|
||||
pmlmeinfo->capability = le16_to_cpu(mgmt->u.assoc_resp.capab_info);
|
||||
|
||||
/* set slot time */
|
||||
pmlmeinfo->slotTime = (pmlmeinfo->capability & BIT(10)) ? 9 : 20;
|
||||
|
||||
/* AID */
|
||||
pmlmeinfo->aid = (int)(le16_to_cpu(*(__le16 *)(pframe + WLAN_HDR_A3_LEN + 4)) & 0x3fff);
|
||||
pmlmeinfo->aid = le16_to_cpu(mgmt->u.assoc_resp.aid) & 0x3fff;
|
||||
res = pmlmeinfo->aid;
|
||||
|
||||
/* following are moved to join event callback function */
|
||||
/* to handle HT, WMM, rate adaptive, update MAC reg */
|
||||
/* for not to handle the synchronous IO in the tasklet */
|
||||
for (i = (6 + WLAN_HDR_A3_LEN); i < pkt_len;) {
|
||||
for (i = offsetof(struct ieee80211_mgmt, u.assoc_resp.variable); i < pkt_len;) {
|
||||
pIE = (struct ndis_802_11_var_ie *)(pframe + i);
|
||||
|
||||
switch (pIE->ElementID) {
|
||||
|
@ -1391,7 +1447,7 @@ unsigned int OnAssocRsp(struct adapter *padapter, struct recv_frame *precv_frame
|
|||
pmlmeinfo->state |= WIFI_FW_ASSOC_SUCCESS;
|
||||
|
||||
/* Update Basic Rate Table for spec, 2010-12-28 , by thomas */
|
||||
UpdateBrateTbl(padapter, pmlmeinfo->network.SupportedRates);
|
||||
UpdateBrateTbl(pmlmeinfo->network.SupportedRates);
|
||||
|
||||
report_assoc_result:
|
||||
report_join_res(padapter, res);
|
||||
|
@ -7858,7 +7914,7 @@ u8 tx_beacon_hdl(struct adapter *padapter, unsigned char *pbuf)
|
|||
|
||||
spin_unlock_bh(&psta_bmc->sleep_q.lock);
|
||||
if (rtl8188eu_hal_xmit(padapter, pxmitframe))
|
||||
rtw_os_xmit_complete(padapter, pxmitframe);
|
||||
rtw_xmit_complete(padapter, pxmitframe);
|
||||
spin_lock_bh(&psta_bmc->sleep_q.lock);
|
||||
}
|
||||
spin_unlock_bh(&psta_bmc->sleep_q.lock);
|
||||
|
|
|
@ -1883,15 +1883,14 @@ void init_wifidirect_info(struct adapter *padapter, enum P2P_ROLE role)
|
|||
|
||||
int rtw_p2p_enable(struct adapter *padapter, enum P2P_ROLE role)
|
||||
{
|
||||
int ret = _SUCCESS;
|
||||
int ret;
|
||||
struct wifidirect_info *pwdinfo = &padapter->wdinfo;
|
||||
|
||||
if (role == P2P_ROLE_DEVICE || role == P2P_ROLE_CLIENT || role == P2P_ROLE_GO) {
|
||||
/* leave IPS/Autosuspend */
|
||||
if (rtw_pwr_wakeup(padapter)) {
|
||||
ret = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
ret = rtw_pwr_wakeup(padapter);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/* Added by Albert 2011/03/22 */
|
||||
/* In the P2P mode, the driver should not support the b mode. */
|
||||
|
@ -1902,10 +1901,9 @@ int rtw_p2p_enable(struct adapter *padapter, enum P2P_ROLE role)
|
|||
init_wifidirect_info(padapter, role);
|
||||
|
||||
} else if (role == P2P_ROLE_DISABLE) {
|
||||
if (rtw_pwr_wakeup(padapter)) {
|
||||
ret = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
ret = rtw_pwr_wakeup(padapter);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/* Disable P2P function */
|
||||
if (!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) {
|
||||
|
@ -1923,6 +1921,5 @@ int rtw_p2p_enable(struct adapter *padapter, enum P2P_ROLE role)
|
|||
update_tx_basic_rate(padapter, padapter->registrypriv.wireless_mode);
|
||||
}
|
||||
|
||||
exit:
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -89,7 +89,7 @@ static bool rtw_pwr_unassociated_idle(struct adapter *adapter)
|
|||
struct wifidirect_info *pwdinfo = &adapter->wdinfo;
|
||||
bool ret = false;
|
||||
|
||||
if (adapter->pwrctrlpriv.ips_deny_time >= jiffies)
|
||||
if (time_after_eq(adapter->pwrctrlpriv.ips_deny_time, jiffies))
|
||||
goto exit;
|
||||
|
||||
if (check_fwstate(pmlmepriv, WIFI_ASOC_STATE | WIFI_SITE_MONITOR) ||
|
||||
|
|
|
@ -6,8 +6,6 @@
|
|||
#include <linux/ieee80211.h>
|
||||
#include "../include/osdep_service.h"
|
||||
#include "../include/drv_types.h"
|
||||
#include "../include/recv_osdep.h"
|
||||
#include "../include/mlme_osdep.h"
|
||||
#include "../include/usb_ops.h"
|
||||
#include "../include/wifi.h"
|
||||
#include "../include/rtl8188e_recv.h"
|
||||
|
@ -37,6 +35,69 @@ void _rtw_init_sta_recv_priv(struct sta_recv_priv *psta_recvpriv)
|
|||
|
||||
}
|
||||
|
||||
static int rtl8188eu_init_recv_priv(struct adapter *padapter)
|
||||
{
|
||||
struct recv_priv *precvpriv = &padapter->recvpriv;
|
||||
int i, res = _SUCCESS;
|
||||
struct recv_buf *precvbuf;
|
||||
|
||||
tasklet_init(&precvpriv->recv_tasklet,
|
||||
rtl8188eu_recv_tasklet,
|
||||
(unsigned long)padapter);
|
||||
|
||||
/* init recv_buf */
|
||||
rtw_init_queue(&precvpriv->free_recv_buf_queue);
|
||||
|
||||
precvpriv->pallocated_recv_buf = kzalloc(NR_RECVBUFF * sizeof(struct recv_buf) + 4,
|
||||
GFP_KERNEL);
|
||||
if (!precvpriv->pallocated_recv_buf) {
|
||||
res = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
precvpriv->precv_buf = (u8 *)ALIGN((size_t)(precvpriv->pallocated_recv_buf), 4);
|
||||
|
||||
precvbuf = (struct recv_buf *)precvpriv->precv_buf;
|
||||
|
||||
for (i = 0; i < NR_RECVBUFF; i++) {
|
||||
precvbuf->pskb = NULL;
|
||||
precvbuf->reuse = false;
|
||||
precvbuf->purb = usb_alloc_urb(0, GFP_KERNEL);
|
||||
if (!precvbuf->purb) {
|
||||
res = _FAIL;
|
||||
break;
|
||||
}
|
||||
precvbuf->adapter = padapter;
|
||||
precvbuf++;
|
||||
}
|
||||
precvpriv->free_recv_buf_queue_cnt = NR_RECVBUFF;
|
||||
skb_queue_head_init(&precvpriv->rx_skb_queue);
|
||||
{
|
||||
int i;
|
||||
size_t tmpaddr = 0;
|
||||
size_t alignment = 0;
|
||||
struct sk_buff *pskb = NULL;
|
||||
|
||||
skb_queue_head_init(&precvpriv->free_recv_skb_queue);
|
||||
|
||||
for (i = 0; i < NR_PREALLOC_RECV_SKB; i++) {
|
||||
pskb = __netdev_alloc_skb(padapter->pnetdev,
|
||||
MAX_RECVBUF_SZ + RECVBUFF_ALIGN_SZ, GFP_KERNEL);
|
||||
if (pskb) {
|
||||
pskb->dev = padapter->pnetdev;
|
||||
tmpaddr = (size_t)pskb->data;
|
||||
alignment = tmpaddr & (RECVBUFF_ALIGN_SZ - 1);
|
||||
skb_reserve(pskb, (RECVBUFF_ALIGN_SZ - alignment));
|
||||
|
||||
skb_queue_tail(&precvpriv->free_recv_skb_queue, pskb);
|
||||
}
|
||||
pskb = NULL;
|
||||
}
|
||||
}
|
||||
exit:
|
||||
return res;
|
||||
}
|
||||
|
||||
int _rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *padapter)
|
||||
{
|
||||
int i;
|
||||
|
@ -91,6 +152,26 @@ exit:
|
|||
return res;
|
||||
}
|
||||
|
||||
static void rtl8188eu_free_recv_priv(struct adapter *padapter)
|
||||
{
|
||||
int i;
|
||||
struct recv_buf *precvbuf;
|
||||
struct recv_priv *precvpriv = &padapter->recvpriv;
|
||||
|
||||
precvbuf = (struct recv_buf *)precvpriv->precv_buf;
|
||||
|
||||
for (i = 0; i < NR_RECVBUFF; i++) {
|
||||
usb_free_urb(precvbuf->purb);
|
||||
precvbuf++;
|
||||
}
|
||||
|
||||
kfree(precvpriv->pallocated_recv_buf);
|
||||
|
||||
skb_queue_purge(&precvpriv->rx_skb_queue);
|
||||
|
||||
skb_queue_purge(&precvpriv->free_recv_skb_queue);
|
||||
}
|
||||
|
||||
void _rtw_free_recv_priv(struct recv_priv *precvpriv)
|
||||
{
|
||||
struct adapter *padapter = precvpriv->adapter;
|
||||
|
@ -244,6 +325,42 @@ u32 rtw_free_uc_swdec_pending_queue(struct adapter *adapter)
|
|||
return cnt;
|
||||
}
|
||||
|
||||
static void rtw_handle_tkip_mic_err(struct adapter *padapter, u8 bgroup)
|
||||
{
|
||||
union iwreq_data wrqu;
|
||||
struct iw_michaelmicfailure ev;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
struct security_priv *psecuritypriv = &padapter->securitypriv;
|
||||
u32 cur_time = 0;
|
||||
|
||||
if (psecuritypriv->last_mic_err_time == 0) {
|
||||
psecuritypriv->last_mic_err_time = jiffies;
|
||||
} else {
|
||||
cur_time = jiffies;
|
||||
|
||||
if (cur_time - psecuritypriv->last_mic_err_time < 60 * HZ) {
|
||||
psecuritypriv->btkip_countermeasure = true;
|
||||
psecuritypriv->last_mic_err_time = 0;
|
||||
psecuritypriv->btkip_countermeasure_time = cur_time;
|
||||
} else {
|
||||
psecuritypriv->last_mic_err_time = jiffies;
|
||||
}
|
||||
}
|
||||
|
||||
memset(&ev, 0x00, sizeof(ev));
|
||||
if (bgroup)
|
||||
ev.flags |= IW_MICFAILURE_GROUP;
|
||||
else
|
||||
ev.flags |= IW_MICFAILURE_PAIRWISE;
|
||||
|
||||
ev.src_addr.sa_family = ARPHRD_ETHER;
|
||||
memcpy(ev.src_addr.sa_data, &pmlmepriv->assoc_bssid[0], ETH_ALEN);
|
||||
memset(&wrqu, 0x00, sizeof(wrqu));
|
||||
wrqu.data.length = sizeof(ev);
|
||||
wireless_send_event(padapter->pnetdev, IWEVMICHAELMICFAILURE,
|
||||
&wrqu, (char *)&ev);
|
||||
}
|
||||
|
||||
static int recvframe_chkmic(struct adapter *adapter, struct recv_frame *precvframe)
|
||||
{
|
||||
int i, res = _SUCCESS;
|
||||
|
@ -1294,7 +1411,6 @@ static int amsdu_to_msdu(struct adapter *padapter, struct recv_frame *prframe)
|
|||
u8 nr_subframes, i;
|
||||
unsigned char *pdata;
|
||||
struct rx_pkt_attrib *pattrib;
|
||||
unsigned char *data_ptr;
|
||||
struct sk_buff *sub_skb, *subframes[MAX_SUBFRAME_COUNT];
|
||||
|
||||
struct recv_priv *precvpriv = &padapter->recvpriv;
|
||||
|
@ -1329,8 +1445,7 @@ static int amsdu_to_msdu(struct adapter *padapter, struct recv_frame *prframe)
|
|||
sub_skb = dev_alloc_skb(nSubframe_Length + 12);
|
||||
if (sub_skb) {
|
||||
skb_reserve(sub_skb, 12);
|
||||
data_ptr = (u8 *)skb_put(sub_skb, nSubframe_Length);
|
||||
memcpy(data_ptr, pdata, nSubframe_Length);
|
||||
skb_put_data(sub_skb, pdata, nSubframe_Length);
|
||||
} else {
|
||||
sub_skb = skb_clone(prframe->pkt, GFP_ATOMIC);
|
||||
if (sub_skb) {
|
||||
|
@ -1460,6 +1575,85 @@ static bool enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl, s
|
|||
return true;
|
||||
}
|
||||
|
||||
static int rtw_recv_indicatepkt(struct adapter *padapter, struct recv_frame *precv_frame)
|
||||
{
|
||||
struct recv_priv *precvpriv;
|
||||
struct __queue *pfree_recv_queue;
|
||||
struct sk_buff *skb;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
|
||||
precvpriv = &padapter->recvpriv;
|
||||
pfree_recv_queue = &precvpriv->free_recv_queue;
|
||||
|
||||
skb = precv_frame->pkt;
|
||||
if (!skb)
|
||||
goto _recv_indicatepkt_drop;
|
||||
|
||||
skb->data = precv_frame->rx_data;
|
||||
|
||||
skb_set_tail_pointer(skb, precv_frame->len);
|
||||
|
||||
skb->len = precv_frame->len;
|
||||
|
||||
if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
|
||||
struct sk_buff *pskb2 = NULL;
|
||||
struct sta_info *psta = NULL;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
struct rx_pkt_attrib *pattrib = &precv_frame->attrib;
|
||||
bool bmcast = is_multicast_ether_addr(pattrib->dst);
|
||||
|
||||
if (memcmp(pattrib->dst, myid(&padapter->eeprompriv), ETH_ALEN)) {
|
||||
if (bmcast) {
|
||||
psta = rtw_get_bcmc_stainfo(padapter);
|
||||
pskb2 = skb_clone(skb, GFP_ATOMIC);
|
||||
} else {
|
||||
psta = rtw_get_stainfo(pstapriv, pattrib->dst);
|
||||
}
|
||||
|
||||
if (psta) {
|
||||
struct net_device *pnetdev;
|
||||
|
||||
pnetdev = (struct net_device *)padapter->pnetdev;
|
||||
skb->dev = pnetdev;
|
||||
skb_set_queue_mapping(skb, rtw_recv_select_queue(skb));
|
||||
|
||||
rtw_xmit_entry(skb, pnetdev);
|
||||
|
||||
if (bmcast)
|
||||
skb = pskb2;
|
||||
else
|
||||
goto _recv_indicatepkt_end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rcu_read_lock();
|
||||
rcu_dereference(padapter->pnetdev->rx_handler_data);
|
||||
rcu_read_unlock();
|
||||
|
||||
skb->ip_summed = CHECKSUM_NONE;
|
||||
skb->dev = padapter->pnetdev;
|
||||
skb->protocol = eth_type_trans(skb, padapter->pnetdev);
|
||||
|
||||
netif_rx(skb);
|
||||
|
||||
_recv_indicatepkt_end:
|
||||
|
||||
/* pointers to NULL before rtw_free_recvframe() */
|
||||
precv_frame->pkt = NULL;
|
||||
|
||||
rtw_free_recvframe(precv_frame, pfree_recv_queue);
|
||||
|
||||
return _SUCCESS;
|
||||
|
||||
_recv_indicatepkt_drop:
|
||||
|
||||
/* enqueue back to free_recv_queue */
|
||||
rtw_free_recvframe(precv_frame, pfree_recv_queue);
|
||||
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
static bool recv_indicatepkts_in_order(struct adapter *padapter, struct recv_reorder_ctrl *preorder_ctrl, int bforced)
|
||||
{
|
||||
struct list_head *phead, *plist;
|
||||
|
|
|
@ -5,9 +5,6 @@
|
|||
|
||||
#include "../include/osdep_service.h"
|
||||
#include "../include/drv_types.h"
|
||||
#include "../include/recv_osdep.h"
|
||||
#include "../include/xmit_osdep.h"
|
||||
#include "../include/mlme_osdep.h"
|
||||
#include "../include/sta_info.h"
|
||||
|
||||
static void _rtw_init_stainfo(struct sta_info *psta)
|
||||
|
@ -141,6 +138,31 @@ void _rtw_free_sta_priv(struct sta_priv *pstapriv)
|
|||
}
|
||||
}
|
||||
|
||||
static void _rtw_reordering_ctrl_timeout_handler(struct timer_list *t)
|
||||
{
|
||||
struct recv_reorder_ctrl *preorder_ctrl;
|
||||
|
||||
preorder_ctrl = from_timer(preorder_ctrl, t, reordering_ctrl_timer);
|
||||
rtw_reordering_ctrl_timeout_handler(preorder_ctrl);
|
||||
}
|
||||
|
||||
static void rtw_init_recv_timer(struct recv_reorder_ctrl *preorder_ctrl)
|
||||
{
|
||||
timer_setup(&preorder_ctrl->reordering_ctrl_timer, _rtw_reordering_ctrl_timeout_handler, 0);
|
||||
}
|
||||
|
||||
static void _addba_timer_hdl(struct timer_list *t)
|
||||
{
|
||||
struct sta_info *psta = from_timer(psta, t, addba_retry_timer);
|
||||
|
||||
addba_timer_hdl(psta);
|
||||
}
|
||||
|
||||
static void init_addba_retry_timer(struct adapter *padapter, struct sta_info *psta)
|
||||
{
|
||||
timer_setup(&psta->addba_retry_timer, _addba_timer_hdl, 0);
|
||||
}
|
||||
|
||||
struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
|
||||
{
|
||||
s32 index;
|
||||
|
|
|
@ -222,46 +222,6 @@ void get_rate_set(struct adapter *padapter, unsigned char *pbssrate, int *bssrat
|
|||
memcpy(pbssrate, supportedrates, *bssrate_len);
|
||||
}
|
||||
|
||||
void UpdateBrateTbl(struct adapter *Adapter, u8 *mbrate)
|
||||
{
|
||||
u8 i;
|
||||
u8 rate;
|
||||
|
||||
/* 1M, 2M, 5.5M, 11M, 6M, 12M, 24M are mandatory. */
|
||||
for (i = 0; i < NDIS_802_11_LENGTH_RATES_EX; i++) {
|
||||
rate = mbrate[i] & 0x7f;
|
||||
switch (rate) {
|
||||
case IEEE80211_CCK_RATE_1MB:
|
||||
case IEEE80211_CCK_RATE_2MB:
|
||||
case IEEE80211_CCK_RATE_5MB:
|
||||
case IEEE80211_CCK_RATE_11MB:
|
||||
case IEEE80211_OFDM_RATE_6MB:
|
||||
case IEEE80211_OFDM_RATE_12MB:
|
||||
case IEEE80211_OFDM_RATE_24MB:
|
||||
mbrate[i] |= IEEE80211_BASIC_RATE_MASK;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateBrateTblForSoftAP(u8 *bssrateset, u32 bssratelen)
|
||||
{
|
||||
u8 i;
|
||||
u8 rate;
|
||||
|
||||
for (i = 0; i < bssratelen; i++) {
|
||||
rate = bssrateset[i] & 0x7f;
|
||||
switch (rate) {
|
||||
case IEEE80211_CCK_RATE_1MB:
|
||||
case IEEE80211_CCK_RATE_2MB:
|
||||
case IEEE80211_CCK_RATE_5MB:
|
||||
case IEEE80211_CCK_RATE_11MB:
|
||||
bssrateset[i] |= IEEE80211_BASIC_RATE_MASK;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Save_DM_Func_Flag(struct adapter *padapter)
|
||||
{
|
||||
struct hal_data_8188e *haldata = &padapter->haldata;
|
||||
|
@ -1578,10 +1538,8 @@ void beacon_timing_control(struct adapter *padapter)
|
|||
|
||||
static struct adapter *pbuddy_padapter;
|
||||
|
||||
int rtw_handle_dualmac(struct adapter *adapter, bool init)
|
||||
void rtw_handle_dualmac(struct adapter *adapter, bool init)
|
||||
{
|
||||
int status = _SUCCESS;
|
||||
|
||||
if (init) {
|
||||
if (!pbuddy_padapter) {
|
||||
pbuddy_padapter = adapter;
|
||||
|
@ -1594,5 +1552,4 @@ int rtw_handle_dualmac(struct adapter *adapter, bool init)
|
|||
} else {
|
||||
pbuddy_padapter = NULL;
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
|
|
@ -33,6 +33,32 @@ void _rtw_init_sta_xmit_priv(struct sta_xmit_priv *psta_xmitpriv)
|
|||
INIT_LIST_HEAD(&psta_xmitpriv->apsd);
|
||||
}
|
||||
|
||||
static int rtw_xmit_resource_alloc(struct adapter *padapter, struct xmit_buf *pxmitbuf,
|
||||
u32 alloc_sz)
|
||||
{
|
||||
pxmitbuf->pallocated_buf = kzalloc(alloc_sz, GFP_KERNEL);
|
||||
if (!pxmitbuf->pallocated_buf)
|
||||
return _FAIL;
|
||||
|
||||
pxmitbuf->pbuf = (u8 *)ALIGN((size_t)(pxmitbuf->pallocated_buf), XMITBUF_ALIGN_SZ);
|
||||
pxmitbuf->dma_transfer_addr = 0;
|
||||
|
||||
pxmitbuf->pxmit_urb = usb_alloc_urb(0, GFP_KERNEL);
|
||||
if (!pxmitbuf->pxmit_urb) {
|
||||
kfree(pxmitbuf->pallocated_buf);
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
static void rtw_xmit_resource_free(struct adapter *padapter, struct xmit_buf *pxmitbuf,
|
||||
u32 free_sz)
|
||||
{
|
||||
usb_free_urb(pxmitbuf->pxmit_urb);
|
||||
kfree(pxmitbuf->pallocated_buf);
|
||||
}
|
||||
|
||||
s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)
|
||||
{
|
||||
int i;
|
||||
|
@ -108,7 +134,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)
|
|||
|
||||
if (!pxmitpriv->pallocated_xmitbuf) {
|
||||
res = _FAIL;
|
||||
goto exit;
|
||||
goto free_frame_buf;
|
||||
}
|
||||
|
||||
pxmitpriv->pxmitbuf = (u8 *)ALIGN((size_t)(pxmitpriv->pallocated_xmitbuf), 4);
|
||||
|
@ -125,12 +151,12 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)
|
|||
pxmitbuf->ext_tag = false;
|
||||
|
||||
/* Tx buf allocation may fail sometimes, so sleep and retry. */
|
||||
res = rtw_os_xmit_resource_alloc(padapter, pxmitbuf, (MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ));
|
||||
res = rtw_xmit_resource_alloc(padapter, pxmitbuf, (MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ));
|
||||
if (res == _FAIL) {
|
||||
msleep(10);
|
||||
res = rtw_os_xmit_resource_alloc(padapter, pxmitbuf, (MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ));
|
||||
res = rtw_xmit_resource_alloc(padapter, pxmitbuf, (MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ));
|
||||
if (res == _FAIL)
|
||||
goto exit;
|
||||
goto free_xmitbuf;
|
||||
}
|
||||
|
||||
pxmitbuf->flags = XMIT_VO_QUEUE;
|
||||
|
@ -148,7 +174,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)
|
|||
|
||||
if (!pxmitpriv->pallocated_xmit_extbuf) {
|
||||
res = _FAIL;
|
||||
goto exit;
|
||||
goto free_xmitbuf;
|
||||
}
|
||||
|
||||
pxmitpriv->pxmit_extbuf = (u8 *)ALIGN((size_t)(pxmitpriv->pallocated_xmit_extbuf), 4);
|
||||
|
@ -162,10 +188,10 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)
|
|||
pxmitbuf->padapter = padapter;
|
||||
pxmitbuf->ext_tag = true;
|
||||
|
||||
res = rtw_os_xmit_resource_alloc(padapter, pxmitbuf, max_xmit_extbuf_size + XMITBUF_ALIGN_SZ);
|
||||
res = rtw_xmit_resource_alloc(padapter, pxmitbuf, max_xmit_extbuf_size + XMITBUF_ALIGN_SZ);
|
||||
if (res == _FAIL) {
|
||||
res = _FAIL;
|
||||
goto exit;
|
||||
goto free_xmit_extbuf;
|
||||
}
|
||||
|
||||
list_add_tail(&pxmitbuf->list, &pxmitpriv->free_xmit_extbuf_queue.queue);
|
||||
|
@ -176,7 +202,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)
|
|||
|
||||
if (rtw_alloc_hwxmits(padapter)) {
|
||||
res = _FAIL;
|
||||
goto exit;
|
||||
goto free_xmit_extbuf;
|
||||
}
|
||||
|
||||
rtw_init_hwxmits(pxmitpriv->hwxmits, pxmitpriv->hwxmit_entry);
|
||||
|
@ -200,11 +226,54 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)
|
|||
|
||||
rtl8188eu_init_xmit_priv(padapter);
|
||||
|
||||
exit:
|
||||
return _SUCCESS;
|
||||
|
||||
free_xmit_extbuf:
|
||||
pxmitbuf = (struct xmit_buf *)pxmitpriv->pxmit_extbuf;
|
||||
while (i--) {
|
||||
rtw_xmit_resource_free(padapter, pxmitbuf, (max_xmit_extbuf_size + XMITBUF_ALIGN_SZ));
|
||||
pxmitbuf++;
|
||||
}
|
||||
vfree(pxmitpriv->pallocated_xmit_extbuf);
|
||||
i = NR_XMITBUFF;
|
||||
free_xmitbuf:
|
||||
pxmitbuf = (struct xmit_buf *)pxmitpriv->pxmitbuf;
|
||||
while (i--) {
|
||||
rtw_xmit_resource_free(padapter, pxmitbuf, (MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ));
|
||||
pxmitbuf++;
|
||||
}
|
||||
vfree(pxmitpriv->pallocated_xmitbuf);
|
||||
free_frame_buf:
|
||||
vfree(pxmitpriv->pallocated_frame_buf);
|
||||
exit:
|
||||
return res;
|
||||
}
|
||||
|
||||
static void rtw_pkt_complete(struct adapter *padapter, struct sk_buff *pkt)
|
||||
{
|
||||
u16 queue;
|
||||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
|
||||
queue = skb_get_queue_mapping(pkt);
|
||||
if (padapter->registrypriv.wifi_spec) {
|
||||
if (__netif_subqueue_stopped(padapter->pnetdev, queue) &&
|
||||
(pxmitpriv->hwxmits[queue].accnt < WMM_XMIT_THRESHOLD))
|
||||
netif_wake_subqueue(padapter->pnetdev, queue);
|
||||
} else {
|
||||
if (__netif_subqueue_stopped(padapter->pnetdev, queue))
|
||||
netif_wake_subqueue(padapter->pnetdev, queue);
|
||||
}
|
||||
|
||||
dev_kfree_skb_any(pkt);
|
||||
}
|
||||
|
||||
void rtw_xmit_complete(struct adapter *padapter, struct xmit_frame *pxframe)
|
||||
{
|
||||
if (pxframe->pkt)
|
||||
rtw_pkt_complete(padapter, pxframe->pkt);
|
||||
pxframe->pkt = NULL;
|
||||
}
|
||||
|
||||
void _rtw_free_xmit_priv(struct xmit_priv *pxmitpriv)
|
||||
{
|
||||
int i;
|
||||
|
@ -218,13 +287,13 @@ void _rtw_free_xmit_priv(struct xmit_priv *pxmitpriv)
|
|||
return;
|
||||
|
||||
for (i = 0; i < NR_XMITFRAME; i++) {
|
||||
rtw_os_xmit_complete(padapter, pxmitframe);
|
||||
rtw_xmit_complete(padapter, pxmitframe);
|
||||
|
||||
pxmitframe++;
|
||||
}
|
||||
|
||||
for (i = 0; i < NR_XMITBUFF; i++) {
|
||||
rtw_os_xmit_resource_free(padapter, pxmitbuf, (MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ));
|
||||
rtw_xmit_resource_free(padapter, pxmitbuf, (MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ));
|
||||
pxmitbuf++;
|
||||
}
|
||||
|
||||
|
@ -234,7 +303,7 @@ void _rtw_free_xmit_priv(struct xmit_priv *pxmitpriv)
|
|||
|
||||
pxmitbuf = (struct xmit_buf *)pxmitpriv->pxmit_extbuf;
|
||||
for (i = 0; i < num_xmit_extbuf; i++) {
|
||||
rtw_os_xmit_resource_free(padapter, pxmitbuf, (max_xmit_extbuf_size + XMITBUF_ALIGN_SZ));
|
||||
rtw_xmit_resource_free(padapter, pxmitbuf, (max_xmit_extbuf_size + XMITBUF_ALIGN_SZ));
|
||||
pxmitbuf++;
|
||||
}
|
||||
|
||||
|
@ -378,18 +447,59 @@ u8 qos_acm(u8 acm_mask, u8 priority)
|
|||
return change_priority;
|
||||
}
|
||||
|
||||
static void rtw_open_pktfile(struct sk_buff *pktptr, struct pkt_file *pfile)
|
||||
{
|
||||
if (!pktptr) {
|
||||
pr_err("8188eu: pktptr is NULL\n");
|
||||
return;
|
||||
}
|
||||
if (!pfile) {
|
||||
pr_err("8188eu: pfile is NULL\n");
|
||||
return;
|
||||
}
|
||||
pfile->pkt = pktptr;
|
||||
pfile->cur_addr = pktptr->data;
|
||||
pfile->buf_start = pktptr->data;
|
||||
pfile->pkt_len = pktptr->len;
|
||||
pfile->buf_len = pktptr->len;
|
||||
|
||||
pfile->cur_buffer = pfile->buf_start;
|
||||
}
|
||||
|
||||
static uint rtw_remainder_len(struct pkt_file *pfile)
|
||||
{
|
||||
return pfile->buf_len - ((size_t)(pfile->cur_addr) -
|
||||
(size_t)(pfile->buf_start));
|
||||
}
|
||||
|
||||
static uint rtw_pktfile_read(struct pkt_file *pfile, u8 *rmem, uint rlen)
|
||||
{
|
||||
uint len;
|
||||
|
||||
len = rtw_remainder_len(pfile);
|
||||
len = (rlen > len) ? len : rlen;
|
||||
|
||||
if (rmem)
|
||||
skb_copy_bits(pfile->pkt, pfile->buf_len - pfile->pkt_len, rmem, len);
|
||||
|
||||
pfile->cur_addr += len;
|
||||
pfile->pkt_len -= len;
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
static void set_qos(struct pkt_file *ppktfile, struct pkt_attrib *pattrib)
|
||||
{
|
||||
struct ethhdr etherhdr;
|
||||
struct iphdr ip_hdr;
|
||||
s32 user_prio = 0;
|
||||
|
||||
_rtw_open_pktfile(ppktfile->pkt, ppktfile);
|
||||
_rtw_pktfile_read(ppktfile, (unsigned char *)ðerhdr, ETH_HLEN);
|
||||
rtw_open_pktfile(ppktfile->pkt, ppktfile);
|
||||
rtw_pktfile_read(ppktfile, (unsigned char *)ðerhdr, ETH_HLEN);
|
||||
|
||||
/* get user_prio from IP hdr */
|
||||
if (pattrib->ether_type == 0x0800) {
|
||||
_rtw_pktfile_read(ppktfile, (u8 *)&ip_hdr, sizeof(ip_hdr));
|
||||
rtw_pktfile_read(ppktfile, (u8 *)&ip_hdr, sizeof(ip_hdr));
|
||||
/* user_prio = (ntohs(ip_hdr.tos) >> 5) & 0x3; */
|
||||
user_prio = ip_hdr.tos >> 5;
|
||||
} else if (pattrib->ether_type == 0x888e) {
|
||||
|
@ -418,8 +528,8 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p
|
|||
|
||||
|
||||
|
||||
_rtw_open_pktfile(pkt, &pktfile);
|
||||
_rtw_pktfile_read(&pktfile, (u8 *)ðerhdr, ETH_HLEN);
|
||||
rtw_open_pktfile(pkt, &pktfile);
|
||||
rtw_pktfile_read(&pktfile, (u8 *)ðerhdr, ETH_HLEN);
|
||||
|
||||
pattrib->ether_type = ntohs(etherhdr.h_proto);
|
||||
|
||||
|
@ -447,7 +557,7 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p
|
|||
/* to prevent DHCP protocol fail */
|
||||
u8 tmp[24];
|
||||
|
||||
_rtw_pktfile_read(&pktfile, &tmp[0], 24);
|
||||
rtw_pktfile_read(&pktfile, &tmp[0], 24);
|
||||
pattrib->dhcp_pkt = 0;
|
||||
if (pktfile.pkt_len > 282) {/* MINIMUM_DHCP_PACKET_SIZE) { */
|
||||
if (((tmp[21] == 68) && (tmp[23] == 67)) ||
|
||||
|
@ -460,9 +570,6 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p
|
|||
}
|
||||
}
|
||||
|
||||
if ((pattrib->ether_type == 0x888e) || (pattrib->dhcp_pkt == 1))
|
||||
rtw_set_scan_deny(padapter, 3000);
|
||||
|
||||
/* If EAPOL , ARP , OR DHCP packet, driver must be in active mode. */
|
||||
if ((pattrib->ether_type == 0x0806) || (pattrib->ether_type == 0x888e) || (pattrib->dhcp_pkt == 1))
|
||||
rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_SPECIAL_PACKET, 1);
|
||||
|
@ -897,8 +1004,8 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct
|
|||
goto exit;
|
||||
}
|
||||
|
||||
_rtw_open_pktfile(pkt, &pktfile);
|
||||
_rtw_pktfile_read(&pktfile, NULL, pattrib->pkt_hdrlen);
|
||||
rtw_open_pktfile(pkt, &pktfile);
|
||||
rtw_pktfile_read(&pktfile, NULL, pattrib->pkt_hdrlen);
|
||||
|
||||
frg_inx = 0;
|
||||
frg_len = pxmitpriv->frag_len - 4;/* 2346-4 = 2342 */
|
||||
|
@ -956,9 +1063,9 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct
|
|||
|
||||
if (bmcst) {
|
||||
/* don't do fragment to broadcast/multicast packets */
|
||||
mem_sz = _rtw_pktfile_read(&pktfile, pframe, pattrib->pktlen);
|
||||
mem_sz = rtw_pktfile_read(&pktfile, pframe, pattrib->pktlen);
|
||||
} else {
|
||||
mem_sz = _rtw_pktfile_read(&pktfile, pframe, mpdu_len);
|
||||
mem_sz = rtw_pktfile_read(&pktfile, pframe, mpdu_len);
|
||||
}
|
||||
|
||||
pframe += mem_sz;
|
||||
|
@ -970,7 +1077,7 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct
|
|||
|
||||
frg_inx++;
|
||||
|
||||
if (bmcst || rtw_endofpktfile(&pktfile)) {
|
||||
if (bmcst || pktfile.pkt_len == 0) {
|
||||
pattrib->nr_frags = frg_inx;
|
||||
|
||||
pattrib->last_txcmdsz = pattrib->hdrlen + pattrib->iv_len + ((pattrib->nr_frags == 1) ? llc_sz : 0) +
|
||||
|
@ -1286,7 +1393,7 @@ s32 rtw_free_xmitframe(struct xmit_priv *pxmitpriv, struct xmit_frame *pxmitfram
|
|||
spin_unlock_bh(&pfree_xmit_queue->lock);
|
||||
|
||||
if (pndis_pkt)
|
||||
rtw_os_pkt_complete(padapter, pndis_pkt);
|
||||
rtw_pkt_complete(padapter, pndis_pkt);
|
||||
|
||||
exit:
|
||||
|
||||
|
@ -1945,7 +2052,7 @@ void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta)
|
|||
|
||||
spin_unlock_bh(&psta->sleep_q.lock);
|
||||
if (rtl8188eu_hal_xmit(padapter, pxmitframe))
|
||||
rtw_os_xmit_complete(padapter, pxmitframe);
|
||||
rtw_xmit_complete(padapter, pxmitframe);
|
||||
spin_lock_bh(&psta->sleep_q.lock);
|
||||
}
|
||||
|
||||
|
@ -1995,7 +2102,7 @@ void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta)
|
|||
|
||||
spin_unlock_bh(&psta_bmc->sleep_q.lock);
|
||||
if (rtl8188eu_hal_xmit(padapter, pxmitframe))
|
||||
rtw_os_xmit_complete(padapter, pxmitframe);
|
||||
rtw_xmit_complete(padapter, pxmitframe);
|
||||
spin_lock_bh(&psta_bmc->sleep_q.lock);
|
||||
}
|
||||
|
||||
|
@ -2069,7 +2176,7 @@ void xmit_delivery_enabled_frames(struct adapter *padapter, struct sta_info *pst
|
|||
pxmitframe->attrib.triggered = 1;
|
||||
|
||||
if (rtl8188eu_hal_xmit(padapter, pxmitframe))
|
||||
rtw_os_xmit_complete(padapter, pxmitframe);
|
||||
rtw_xmit_complete(padapter, pxmitframe);
|
||||
|
||||
if ((psta->sleepq_ac_len == 0) && (!psta->has_legacy_ac) && (wmmps_ac)) {
|
||||
pstapriv->tim_bitmap &= ~BIT(psta->aid);
|
||||
|
@ -2136,3 +2243,105 @@ void rtw_ack_tx_done(struct xmit_priv *pxmitpriv, int status)
|
|||
if (pxmitpriv->ack_tx)
|
||||
rtw_sctx_done_err(&pack_tx_ops, status);
|
||||
}
|
||||
|
||||
static void rtw_check_xmit_resource(struct adapter *padapter, struct sk_buff *pkt)
|
||||
{
|
||||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
u16 queue;
|
||||
|
||||
queue = skb_get_queue_mapping(pkt);
|
||||
if (padapter->registrypriv.wifi_spec) {
|
||||
/* No free space for Tx, tx_worker is too slow */
|
||||
if (pxmitpriv->hwxmits[queue].accnt > WMM_XMIT_THRESHOLD)
|
||||
netif_stop_subqueue(padapter->pnetdev, queue);
|
||||
} else {
|
||||
if (pxmitpriv->free_xmitframe_cnt <= 4) {
|
||||
if (!netif_tx_queue_stopped(netdev_get_tx_queue(padapter->pnetdev, queue)))
|
||||
netif_stop_subqueue(padapter->pnetdev, queue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static int rtw_mlcst2unicst(struct adapter *padapter, struct sk_buff *skb)
|
||||
{
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
struct list_head *phead, *plist;
|
||||
struct sk_buff *newskb;
|
||||
struct sta_info *psta = NULL;
|
||||
s32 res;
|
||||
|
||||
spin_lock_bh(&pstapriv->asoc_list_lock);
|
||||
phead = &pstapriv->asoc_list;
|
||||
plist = phead->next;
|
||||
|
||||
/* free sta asoc_queue */
|
||||
while (phead != plist) {
|
||||
psta = container_of(plist, struct sta_info, asoc_list);
|
||||
|
||||
plist = plist->next;
|
||||
|
||||
/* avoid come from STA1 and send back STA1 */
|
||||
if (!memcmp(psta->hwaddr, &skb->data[6], 6))
|
||||
continue;
|
||||
|
||||
newskb = skb_copy(skb, GFP_ATOMIC);
|
||||
|
||||
if (newskb) {
|
||||
memcpy(newskb->data, psta->hwaddr, 6);
|
||||
res = rtw_xmit(padapter, &newskb);
|
||||
if (res < 0) {
|
||||
pxmitpriv->tx_drop++;
|
||||
dev_kfree_skb_any(newskb);
|
||||
} else {
|
||||
pxmitpriv->tx_pkts++;
|
||||
}
|
||||
} else {
|
||||
pxmitpriv->tx_drop++;
|
||||
|
||||
spin_unlock_bh(&pstapriv->asoc_list_lock);
|
||||
return false; /* Caller shall tx this multicast frame via normal way. */
|
||||
}
|
||||
}
|
||||
|
||||
spin_unlock_bh(&pstapriv->asoc_list_lock);
|
||||
dev_kfree_skb_any(skb);
|
||||
return true;
|
||||
}
|
||||
|
||||
netdev_tx_t rtw_xmit_entry(struct sk_buff *pkt, struct net_device *pnetdev)
|
||||
{
|
||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(pnetdev);
|
||||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
s32 res = 0;
|
||||
|
||||
if (!rtw_if_up(padapter))
|
||||
goto drop_packet;
|
||||
|
||||
rtw_check_xmit_resource(padapter, pkt);
|
||||
|
||||
if (!rtw_mc2u_disable && check_fwstate(pmlmepriv, WIFI_AP_STATE) &&
|
||||
(IP_MCAST_MAC(pkt->data) || ICMPV6_MCAST_MAC(pkt->data)) &&
|
||||
(padapter->registrypriv.wifi_spec == 0)) {
|
||||
if (pxmitpriv->free_xmitframe_cnt > (NR_XMITFRAME / 4)) {
|
||||
res = rtw_mlcst2unicst(padapter, pkt);
|
||||
if (res)
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
|
||||
res = rtw_xmit(padapter, &pkt);
|
||||
if (res < 0)
|
||||
goto drop_packet;
|
||||
|
||||
pxmitpriv->tx_pkts++;
|
||||
goto exit;
|
||||
|
||||
drop_packet:
|
||||
pxmitpriv->tx_drop++;
|
||||
dev_kfree_skb_any(pkt);
|
||||
|
||||
exit:
|
||||
return NETDEV_TX_OK;
|
||||
}
|
||||
|
|
|
@ -166,7 +166,14 @@ static u32 array_agc_tab_1t_8188e[] = {
|
|||
0xC78, 0x407F0001,
|
||||
};
|
||||
|
||||
enum HAL_STATUS ODM_ReadAndConfig_AGC_TAB_1T_8188E(struct odm_dm_struct *dm_odm)
|
||||
static void odm_ConfigBB_AGC_8188E(struct odm_dm_struct *pDM_Odm, u32 Addr, u32 Bitmask, u32 Data)
|
||||
{
|
||||
rtl8188e_PHY_SetBBReg(pDM_Odm->Adapter, Addr, Bitmask, Data);
|
||||
/* Add 1us delay between BB/RF register setting. */
|
||||
udelay(1);
|
||||
}
|
||||
|
||||
int ODM_ReadAndConfig_AGC_TAB_1T_8188E(struct odm_dm_struct *dm_odm)
|
||||
{
|
||||
u32 hex = 0;
|
||||
u32 i = 0;
|
||||
|
@ -176,7 +183,6 @@ enum HAL_STATUS ODM_ReadAndConfig_AGC_TAB_1T_8188E(struct odm_dm_struct *dm_odm)
|
|||
struct adapter *adapter = dm_odm->Adapter;
|
||||
struct xmit_frame *pxmit_frame = NULL;
|
||||
u8 bndy_cnt = 1;
|
||||
enum HAL_STATUS rst = HAL_STATUS_SUCCESS;
|
||||
|
||||
hex += ODM_ITRF_USB << 8;
|
||||
hex += ODM_CE << 16;
|
||||
|
@ -187,7 +193,7 @@ enum HAL_STATUS ODM_ReadAndConfig_AGC_TAB_1T_8188E(struct odm_dm_struct *dm_odm)
|
|||
pxmit_frame = rtw_IOL_accquire_xmit_frame(adapter);
|
||||
if (!pxmit_frame) {
|
||||
pr_info("rtw_IOL_accquire_xmit_frame failed\n");
|
||||
return HAL_STATUS_FAILURE;
|
||||
return -ENOMEM;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -238,10 +244,10 @@ enum HAL_STATUS ODM_ReadAndConfig_AGC_TAB_1T_8188E(struct odm_dm_struct *dm_odm)
|
|||
if (biol) {
|
||||
if (!rtl8188e_IOL_exec_cmds_sync(dm_odm->Adapter, pxmit_frame, 1000, bndy_cnt)) {
|
||||
printk("~~~ %s IOL_exec_cmds Failed !!!\n", __func__);
|
||||
rst = HAL_STATUS_FAILURE;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return rst;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
|
@ -442,7 +448,31 @@ static u32 array_phy_reg_1t_8188e[] = {
|
|||
0xF00, 0x00000300,
|
||||
};
|
||||
|
||||
enum HAL_STATUS ODM_ReadAndConfig_PHY_REG_1T_8188E(struct odm_dm_struct *dm_odm)
|
||||
static void odm_ConfigBB_PHY_8188E(struct odm_dm_struct *pDM_Odm, u32 Addr, u32 Bitmask, u32 Data)
|
||||
{
|
||||
if (Addr == 0xfe) {
|
||||
msleep(50);
|
||||
} else if (Addr == 0xfd) {
|
||||
mdelay(5);
|
||||
} else if (Addr == 0xfc) {
|
||||
mdelay(1);
|
||||
} else if (Addr == 0xfb) {
|
||||
udelay(50);
|
||||
} else if (Addr == 0xfa) {
|
||||
udelay(5);
|
||||
} else if (Addr == 0xf9) {
|
||||
udelay(1);
|
||||
} else {
|
||||
if (Addr == 0xa24)
|
||||
pDM_Odm->RFCalibrateInfo.RegA24 = Data;
|
||||
rtl8188e_PHY_SetBBReg(pDM_Odm->Adapter, Addr, Bitmask, Data);
|
||||
|
||||
/* Add 1us delay between BB/RF register setting. */
|
||||
udelay(1);
|
||||
}
|
||||
}
|
||||
|
||||
int ODM_ReadAndConfig_PHY_REG_1T_8188E(struct odm_dm_struct *dm_odm)
|
||||
{
|
||||
u32 hex = 0;
|
||||
u32 i = 0;
|
||||
|
@ -452,7 +482,6 @@ enum HAL_STATUS ODM_ReadAndConfig_PHY_REG_1T_8188E(struct odm_dm_struct *dm_odm)
|
|||
struct adapter *adapter = dm_odm->Adapter;
|
||||
struct xmit_frame *pxmit_frame = NULL;
|
||||
u8 bndy_cnt = 1;
|
||||
enum HAL_STATUS rst = HAL_STATUS_SUCCESS;
|
||||
hex += ODM_ITRF_USB << 8;
|
||||
hex += ODM_CE << 16;
|
||||
hex += 0xFF000000;
|
||||
|
@ -462,7 +491,7 @@ enum HAL_STATUS ODM_ReadAndConfig_PHY_REG_1T_8188E(struct odm_dm_struct *dm_odm)
|
|||
pxmit_frame = rtw_IOL_accquire_xmit_frame(adapter);
|
||||
if (!pxmit_frame) {
|
||||
pr_info("rtw_IOL_accquire_xmit_frame failed\n");
|
||||
return HAL_STATUS_FAILURE;
|
||||
return -ENOMEM;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -544,11 +573,11 @@ enum HAL_STATUS ODM_ReadAndConfig_PHY_REG_1T_8188E(struct odm_dm_struct *dm_odm)
|
|||
}
|
||||
if (biol) {
|
||||
if (!rtl8188e_IOL_exec_cmds_sync(dm_odm->Adapter, pxmit_frame, 1000, bndy_cnt)) {
|
||||
rst = HAL_STATUS_FAILURE;
|
||||
pr_info("~~~ IOL Config %s Failed !!!\n", __func__);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return rst;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
|
@ -647,6 +676,25 @@ static u32 array_phy_reg_pg_8188e[] = {
|
|||
|
||||
};
|
||||
|
||||
static void odm_ConfigBB_PHY_REG_PG_8188E(struct odm_dm_struct *pDM_Odm, u32 Addr, u32 Bitmask,
|
||||
u32 Data)
|
||||
{
|
||||
if (Addr == 0xfe)
|
||||
msleep(50);
|
||||
else if (Addr == 0xfd)
|
||||
mdelay(5);
|
||||
else if (Addr == 0xfc)
|
||||
mdelay(1);
|
||||
else if (Addr == 0xfb)
|
||||
udelay(50);
|
||||
else if (Addr == 0xfa)
|
||||
udelay(5);
|
||||
else if (Addr == 0xf9)
|
||||
udelay(1);
|
||||
else
|
||||
storePwrIndexDiffRateOffset(pDM_Odm->Adapter, Addr, Bitmask, Data);
|
||||
}
|
||||
|
||||
void ODM_ReadAndConfig_PHY_REG_PG_8188E(struct odm_dm_struct *dm_odm)
|
||||
{
|
||||
u32 hex;
|
||||
|
|
|
@ -126,7 +126,12 @@ static u32 array_MAC_REG_8188E[] = {
|
|||
0x70B, 0x00000087,
|
||||
};
|
||||
|
||||
enum HAL_STATUS ODM_ReadAndConfig_MAC_REG_8188E(struct odm_dm_struct *dm_odm)
|
||||
static void odm_ConfigMAC_8188E(struct odm_dm_struct *pDM_Odm, u32 Addr, u8 Data)
|
||||
{
|
||||
rtw_write8(pDM_Odm->Adapter, Addr, Data);
|
||||
}
|
||||
|
||||
int ODM_ReadAndConfig_MAC_REG_8188E(struct odm_dm_struct *dm_odm)
|
||||
{
|
||||
#define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = array[i]; v2 = array[i + 1]; } while (0)
|
||||
|
||||
|
@ -139,7 +144,6 @@ enum HAL_STATUS ODM_ReadAndConfig_MAC_REG_8188E(struct odm_dm_struct *dm_odm)
|
|||
struct adapter *adapt = dm_odm->Adapter;
|
||||
struct xmit_frame *pxmit_frame = NULL;
|
||||
u8 bndy_cnt = 1;
|
||||
enum HAL_STATUS rst = HAL_STATUS_SUCCESS;
|
||||
hex += ODM_ITRF_USB << 8;
|
||||
hex += ODM_CE << 16;
|
||||
hex += 0xFF000000;
|
||||
|
@ -150,7 +154,7 @@ enum HAL_STATUS ODM_ReadAndConfig_MAC_REG_8188E(struct odm_dm_struct *dm_odm)
|
|||
pxmit_frame = rtw_IOL_accquire_xmit_frame(adapt);
|
||||
if (!pxmit_frame) {
|
||||
pr_info("rtw_IOL_accquire_xmit_frame failed\n");
|
||||
return HAL_STATUS_FAILURE;
|
||||
return -ENOMEM;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -201,8 +205,8 @@ enum HAL_STATUS ODM_ReadAndConfig_MAC_REG_8188E(struct odm_dm_struct *dm_odm)
|
|||
if (biol) {
|
||||
if (!rtl8188e_IOL_exec_cmds_sync(dm_odm->Adapter, pxmit_frame, 1000, bndy_cnt)) {
|
||||
pr_info("~~~ MAC IOL_exec_cmds Failed !!!\n");
|
||||
rst = HAL_STATUS_FAILURE;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return rst;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -130,7 +130,37 @@ static u32 Array_RadioA_1T_8188E[] = {
|
|||
0x000, 0x00033E60,
|
||||
};
|
||||
|
||||
enum HAL_STATUS ODM_ReadAndConfig_RadioA_1T_8188E(struct odm_dm_struct *pDM_Odm)
|
||||
static void odm_ConfigRFReg_8188E(struct odm_dm_struct *pDM_Odm, u32 Addr,
|
||||
u32 Data, u32 RegAddr)
|
||||
{
|
||||
if (Addr == 0xffe) {
|
||||
msleep(50);
|
||||
} else if (Addr == 0xfd) {
|
||||
mdelay(5);
|
||||
} else if (Addr == 0xfc) {
|
||||
mdelay(1);
|
||||
} else if (Addr == 0xfb) {
|
||||
udelay(50);
|
||||
} else if (Addr == 0xfa) {
|
||||
udelay(5);
|
||||
} else if (Addr == 0xf9) {
|
||||
udelay(1);
|
||||
} else {
|
||||
rtl8188e_PHY_SetRFReg(pDM_Odm->Adapter, RegAddr, bRFRegOffsetMask, Data);
|
||||
/* Add 1us delay between BB/RF register setting. */
|
||||
udelay(1);
|
||||
}
|
||||
}
|
||||
|
||||
static void odm_ConfigRF_RadioA_8188E(struct odm_dm_struct *pDM_Odm, u32 Addr, u32 Data)
|
||||
{
|
||||
u32 content = 0x1000; /* RF_Content: radioa_txt */
|
||||
u32 maskforPhySet = (u32)(content & 0xE000);
|
||||
|
||||
odm_ConfigRFReg_8188E(pDM_Odm, Addr, Data, Addr | maskforPhySet);
|
||||
}
|
||||
|
||||
int ODM_ReadAndConfig_RadioA_1T_8188E(struct odm_dm_struct *pDM_Odm)
|
||||
{
|
||||
#define READ_NEXT_PAIR(v1, v2, i) do \
|
||||
{ i += 2; v1 = Array[i]; \
|
||||
|
@ -144,7 +174,6 @@ enum HAL_STATUS ODM_ReadAndConfig_RadioA_1T_8188E(struct odm_dm_struct *pDM_Odm)
|
|||
struct adapter *Adapter = pDM_Odm->Adapter;
|
||||
struct xmit_frame *pxmit_frame = NULL;
|
||||
u8 bndy_cnt = 1;
|
||||
enum HAL_STATUS rst = HAL_STATUS_SUCCESS;
|
||||
|
||||
hex += ODM_ITRF_USB << 8;
|
||||
hex += ODM_CE << 16;
|
||||
|
@ -155,7 +184,7 @@ enum HAL_STATUS ODM_ReadAndConfig_RadioA_1T_8188E(struct odm_dm_struct *pDM_Odm)
|
|||
pxmit_frame = rtw_IOL_accquire_xmit_frame(Adapter);
|
||||
if (!pxmit_frame) {
|
||||
pr_info("rtw_IOL_accquire_xmit_frame failed\n");
|
||||
return HAL_STATUS_FAILURE;
|
||||
return -ENOMEM;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -232,9 +261,9 @@ enum HAL_STATUS ODM_ReadAndConfig_RadioA_1T_8188E(struct odm_dm_struct *pDM_Odm)
|
|||
}
|
||||
if (biol) {
|
||||
if (!rtl8188e_IOL_exec_cmds_sync(pDM_Odm->Adapter, pxmit_frame, 1000, bndy_cnt)) {
|
||||
rst = HAL_STATUS_FAILURE;
|
||||
pr_info("~~~ IOL Config %s Failed !!!\n", __func__);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return rst;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -137,176 +137,3 @@ void HalSetBrateCfg(struct adapter *adapt, u8 *brates, u16 *rate_cfg)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void one_out_pipe(struct adapter *adapter)
|
||||
{
|
||||
struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(adapter);
|
||||
|
||||
pdvobjpriv->Queue2Pipe[0] = pdvobjpriv->RtOutPipe[0];/* VO */
|
||||
pdvobjpriv->Queue2Pipe[1] = pdvobjpriv->RtOutPipe[0];/* VI */
|
||||
pdvobjpriv->Queue2Pipe[2] = pdvobjpriv->RtOutPipe[0];/* BE */
|
||||
pdvobjpriv->Queue2Pipe[3] = pdvobjpriv->RtOutPipe[0];/* BK */
|
||||
|
||||
pdvobjpriv->Queue2Pipe[4] = pdvobjpriv->RtOutPipe[0];/* BCN */
|
||||
pdvobjpriv->Queue2Pipe[5] = pdvobjpriv->RtOutPipe[0];/* MGT */
|
||||
pdvobjpriv->Queue2Pipe[6] = pdvobjpriv->RtOutPipe[0];/* HIGH */
|
||||
pdvobjpriv->Queue2Pipe[7] = pdvobjpriv->RtOutPipe[0];/* TXCMD */
|
||||
}
|
||||
|
||||
static void two_out_pipe(struct adapter *adapter, bool wifi_cfg)
|
||||
{
|
||||
struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(adapter);
|
||||
|
||||
if (wifi_cfg) { /* WMM */
|
||||
/* BK, BE, VI, VO, BCN, CMD, MGT, HIGH, HCCA */
|
||||
/* 0, 1, 0, 1, 0, 0, 0, 0, 0}; */
|
||||
/* 0:H, 1:L */
|
||||
|
||||
pdvobjpriv->Queue2Pipe[0] = pdvobjpriv->RtOutPipe[1];/* VO */
|
||||
pdvobjpriv->Queue2Pipe[1] = pdvobjpriv->RtOutPipe[0];/* VI */
|
||||
pdvobjpriv->Queue2Pipe[2] = pdvobjpriv->RtOutPipe[1];/* BE */
|
||||
pdvobjpriv->Queue2Pipe[3] = pdvobjpriv->RtOutPipe[0];/* BK */
|
||||
|
||||
pdvobjpriv->Queue2Pipe[4] = pdvobjpriv->RtOutPipe[0];/* BCN */
|
||||
pdvobjpriv->Queue2Pipe[5] = pdvobjpriv->RtOutPipe[0];/* MGT */
|
||||
pdvobjpriv->Queue2Pipe[6] = pdvobjpriv->RtOutPipe[0];/* HIGH */
|
||||
pdvobjpriv->Queue2Pipe[7] = pdvobjpriv->RtOutPipe[0];/* TXCMD */
|
||||
|
||||
} else {/* typical setting */
|
||||
/* BK, BE, VI, VO, BCN, CMD, MGT, HIGH, HCCA */
|
||||
/* 1, 1, 0, 0, 0, 0, 0, 0, 0}; */
|
||||
/* 0:H, 1:L */
|
||||
|
||||
pdvobjpriv->Queue2Pipe[0] = pdvobjpriv->RtOutPipe[0];/* VO */
|
||||
pdvobjpriv->Queue2Pipe[1] = pdvobjpriv->RtOutPipe[0];/* VI */
|
||||
pdvobjpriv->Queue2Pipe[2] = pdvobjpriv->RtOutPipe[1];/* BE */
|
||||
pdvobjpriv->Queue2Pipe[3] = pdvobjpriv->RtOutPipe[1];/* BK */
|
||||
|
||||
pdvobjpriv->Queue2Pipe[4] = pdvobjpriv->RtOutPipe[0];/* BCN */
|
||||
pdvobjpriv->Queue2Pipe[5] = pdvobjpriv->RtOutPipe[0];/* MGT */
|
||||
pdvobjpriv->Queue2Pipe[6] = pdvobjpriv->RtOutPipe[0];/* HIGH */
|
||||
pdvobjpriv->Queue2Pipe[7] = pdvobjpriv->RtOutPipe[0];/* TXCMD */
|
||||
}
|
||||
}
|
||||
|
||||
static void three_out_pipe(struct adapter *adapter, bool wifi_cfg)
|
||||
{
|
||||
struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(adapter);
|
||||
|
||||
if (wifi_cfg) {/* for WMM */
|
||||
/* BK, BE, VI, VO, BCN, CMD, MGT, HIGH, HCCA */
|
||||
/* 1, 2, 1, 0, 0, 0, 0, 0, 0}; */
|
||||
/* 0:H, 1:N, 2:L */
|
||||
|
||||
pdvobjpriv->Queue2Pipe[0] = pdvobjpriv->RtOutPipe[0];/* VO */
|
||||
pdvobjpriv->Queue2Pipe[1] = pdvobjpriv->RtOutPipe[1];/* VI */
|
||||
pdvobjpriv->Queue2Pipe[2] = pdvobjpriv->RtOutPipe[2];/* BE */
|
||||
pdvobjpriv->Queue2Pipe[3] = pdvobjpriv->RtOutPipe[1];/* BK */
|
||||
|
||||
pdvobjpriv->Queue2Pipe[4] = pdvobjpriv->RtOutPipe[0];/* BCN */
|
||||
pdvobjpriv->Queue2Pipe[5] = pdvobjpriv->RtOutPipe[0];/* MGT */
|
||||
pdvobjpriv->Queue2Pipe[6] = pdvobjpriv->RtOutPipe[0];/* HIGH */
|
||||
pdvobjpriv->Queue2Pipe[7] = pdvobjpriv->RtOutPipe[0];/* TXCMD */
|
||||
|
||||
} else {/* typical setting */
|
||||
/* BK, BE, VI, VO, BCN, CMD, MGT, HIGH, HCCA */
|
||||
/* 2, 2, 1, 0, 0, 0, 0, 0, 0}; */
|
||||
/* 0:H, 1:N, 2:L */
|
||||
|
||||
pdvobjpriv->Queue2Pipe[0] = pdvobjpriv->RtOutPipe[0];/* VO */
|
||||
pdvobjpriv->Queue2Pipe[1] = pdvobjpriv->RtOutPipe[1];/* VI */
|
||||
pdvobjpriv->Queue2Pipe[2] = pdvobjpriv->RtOutPipe[2];/* BE */
|
||||
pdvobjpriv->Queue2Pipe[3] = pdvobjpriv->RtOutPipe[2];/* BK */
|
||||
|
||||
pdvobjpriv->Queue2Pipe[4] = pdvobjpriv->RtOutPipe[0];/* BCN */
|
||||
pdvobjpriv->Queue2Pipe[5] = pdvobjpriv->RtOutPipe[0];/* MGT */
|
||||
pdvobjpriv->Queue2Pipe[6] = pdvobjpriv->RtOutPipe[0];/* HIGH */
|
||||
pdvobjpriv->Queue2Pipe[7] = pdvobjpriv->RtOutPipe[0];/* TXCMD */
|
||||
}
|
||||
}
|
||||
|
||||
bool Hal_MappingOutPipe(struct adapter *adapter, u8 numoutpipe)
|
||||
{
|
||||
struct registry_priv *pregistrypriv = &adapter->registrypriv;
|
||||
bool wifi_cfg = pregistrypriv->wifi_spec;
|
||||
bool result = true;
|
||||
|
||||
switch (numoutpipe) {
|
||||
case 2:
|
||||
two_out_pipe(adapter, wifi_cfg);
|
||||
break;
|
||||
case 3:
|
||||
three_out_pipe(adapter, wifi_cfg);
|
||||
break;
|
||||
case 1:
|
||||
one_out_pipe(adapter);
|
||||
break;
|
||||
default:
|
||||
result = false;
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* C2H event format:
|
||||
* Field TRIGGER CONTENT CMD_SEQ CMD_LEN CMD_ID
|
||||
* BITS [127:120] [119:16] [15:8] [7:4] [3:0]
|
||||
*/
|
||||
|
||||
s32 c2h_evt_read(struct adapter *adapter, u8 *buf)
|
||||
{
|
||||
s32 ret = _FAIL;
|
||||
struct c2h_evt_hdr *c2h_evt;
|
||||
int i;
|
||||
u8 trigger;
|
||||
|
||||
if (!buf)
|
||||
goto exit;
|
||||
|
||||
ret = rtw_read8(adapter, REG_C2HEVT_CLEAR, &trigger);
|
||||
if (ret)
|
||||
return _FAIL;
|
||||
|
||||
if (trigger == C2H_EVT_HOST_CLOSE)
|
||||
goto exit; /* Not ready */
|
||||
else if (trigger != C2H_EVT_FW_CLOSE)
|
||||
goto clear_evt; /* Not a valid value */
|
||||
|
||||
c2h_evt = (struct c2h_evt_hdr *)buf;
|
||||
|
||||
memset(c2h_evt, 0, 16);
|
||||
|
||||
ret = rtw_read8(adapter, REG_C2HEVT_MSG_NORMAL, buf);
|
||||
if (ret) {
|
||||
ret = _FAIL;
|
||||
goto clear_evt;
|
||||
}
|
||||
|
||||
ret = rtw_read8(adapter, REG_C2HEVT_MSG_NORMAL + 1, buf + 1);
|
||||
if (ret) {
|
||||
ret = _FAIL;
|
||||
goto clear_evt;
|
||||
}
|
||||
/* Read the content */
|
||||
for (i = 0; i < c2h_evt->plen; i++) {
|
||||
ret = rtw_read8(adapter, REG_C2HEVT_MSG_NORMAL +
|
||||
sizeof(*c2h_evt) + i, c2h_evt->payload + i);
|
||||
if (ret) {
|
||||
ret = _FAIL;
|
||||
goto clear_evt;
|
||||
}
|
||||
}
|
||||
|
||||
ret = _SUCCESS;
|
||||
|
||||
clear_evt:
|
||||
/*
|
||||
* Clear event to notify FW we have read the command.
|
||||
* If this field isn't clear, the FW won't update the next
|
||||
* command message.
|
||||
*/
|
||||
rtw_write8(adapter, REG_C2HEVT_CLEAR, C2H_EVT_HOST_CLOSE);
|
||||
exit:
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -3,38 +3,38 @@
|
|||
|
||||
#include "../include/drv_types.h"
|
||||
|
||||
static u8 odm_QueryRxPwrPercentage(s8 AntPower)
|
||||
static u8 odm_query_rxpwrpercentage(s8 antpower)
|
||||
{
|
||||
if ((AntPower <= -100) || (AntPower >= 20))
|
||||
return 0;
|
||||
else if (AntPower >= 0)
|
||||
return 100;
|
||||
if ((antpower <= -100) || (antpower >= 20))
|
||||
return 0;
|
||||
else if (antpower >= 0)
|
||||
return 100;
|
||||
else
|
||||
return 100 + AntPower;
|
||||
return 100 + antpower;
|
||||
}
|
||||
|
||||
static s32 odm_SignalScaleMapping(struct odm_dm_struct *dm_odm, s32 CurrSig)
|
||||
static s32 odm_signal_scale_mapping(struct odm_dm_struct *dm_odm, s32 currsig)
|
||||
{
|
||||
s32 RetSig = 0;
|
||||
s32 retsig;
|
||||
|
||||
if (CurrSig >= 51 && CurrSig <= 100)
|
||||
RetSig = 100;
|
||||
else if (CurrSig >= 41 && CurrSig <= 50)
|
||||
RetSig = 80 + ((CurrSig - 40) * 2);
|
||||
else if (CurrSig >= 31 && CurrSig <= 40)
|
||||
RetSig = 66 + (CurrSig - 30);
|
||||
else if (CurrSig >= 21 && CurrSig <= 30)
|
||||
RetSig = 54 + (CurrSig - 20);
|
||||
else if (CurrSig >= 10 && CurrSig <= 20)
|
||||
RetSig = 42 + (((CurrSig - 10) * 2) / 3);
|
||||
else if (CurrSig >= 5 && CurrSig <= 9)
|
||||
RetSig = 22 + (((CurrSig - 5) * 3) / 2);
|
||||
else if (CurrSig >= 1 && CurrSig <= 4)
|
||||
RetSig = 6 + (((CurrSig - 1) * 3) / 2);
|
||||
if (currsig >= 51 && currsig <= 100)
|
||||
retsig = 100;
|
||||
else if (currsig >= 41 && currsig <= 50)
|
||||
retsig = 80 + ((currsig - 40) * 2);
|
||||
else if (currsig >= 31 && currsig <= 40)
|
||||
retsig = 66 + (currsig - 30);
|
||||
else if (currsig >= 21 && currsig <= 30)
|
||||
retsig = 54 + (currsig - 20);
|
||||
else if (currsig >= 10 && currsig <= 20)
|
||||
retsig = 42 + (((currsig - 10) * 2) / 3);
|
||||
else if (currsig >= 5 && currsig <= 9)
|
||||
retsig = 22 + (((currsig - 5) * 3) / 2);
|
||||
else if (currsig >= 1 && currsig <= 4)
|
||||
retsig = 6 + (((currsig - 1) * 3) / 2);
|
||||
else
|
||||
RetSig = CurrSig;
|
||||
retsig = currsig;
|
||||
|
||||
return RetSig;
|
||||
return retsig;
|
||||
}
|
||||
|
||||
static u8 odm_evm_db_to_percentage(s8 value)
|
||||
|
@ -117,7 +117,7 @@ static void odm_RxPhyStatus92CSeries_Parsing(struct odm_dm_struct *dm_odm,
|
|||
break;
|
||||
}
|
||||
rx_pwr_all += 6;
|
||||
PWDB_ALL = odm_QueryRxPwrPercentage(rx_pwr_all);
|
||||
PWDB_ALL = odm_query_rxpwrpercentage(rx_pwr_all);
|
||||
if (!cck_highpwr) {
|
||||
if (PWDB_ALL >= 80)
|
||||
PWDB_ALL = ((PWDB_ALL - 80) << 1) + ((PWDB_ALL - 80) >> 1) + 80;
|
||||
|
@ -162,7 +162,7 @@ static void odm_RxPhyStatus92CSeries_Parsing(struct odm_dm_struct *dm_odm,
|
|||
pPhyInfo->RxPwr[i] = rx_pwr[i];
|
||||
|
||||
/* Translate DBM to percentage. */
|
||||
RSSI = odm_QueryRxPwrPercentage(rx_pwr[i]);
|
||||
RSSI = odm_query_rxpwrpercentage(rx_pwr[i]);
|
||||
total_rssi += RSSI;
|
||||
|
||||
pPhyInfo->RxMIMOSignalStrength[i] = (u8)RSSI;
|
||||
|
@ -173,7 +173,7 @@ static void odm_RxPhyStatus92CSeries_Parsing(struct odm_dm_struct *dm_odm,
|
|||
/* (2)PWDB, Average PWDB calculated by hardware (for rate adaptive) */
|
||||
rx_pwr_all = (((pPhyStaRpt->cck_sig_qual_ofdm_pwdb_all) >> 1) & 0x7f) - 110;
|
||||
|
||||
PWDB_ALL = odm_QueryRxPwrPercentage(rx_pwr_all);
|
||||
PWDB_ALL = odm_query_rxpwrpercentage(rx_pwr_all);
|
||||
|
||||
pPhyInfo->RxPWDBAll = PWDB_ALL;
|
||||
pPhyInfo->RxPower = rx_pwr_all;
|
||||
|
@ -200,10 +200,10 @@ static void odm_RxPhyStatus92CSeries_Parsing(struct odm_dm_struct *dm_odm,
|
|||
/* UI BSS List signal strength(in percentage), make it good looking, from 0~100. */
|
||||
/* It is assigned to the BSS List in GetValueFromBeaconOrProbeRsp(). */
|
||||
if (isCCKrate) {
|
||||
pPhyInfo->SignalStrength = (u8)(odm_SignalScaleMapping(dm_odm, PWDB_ALL));/* PWDB_ALL; */
|
||||
pPhyInfo->SignalStrength = (u8)(odm_signal_scale_mapping(dm_odm, PWDB_ALL));/* PWDB_ALL; */
|
||||
} else {
|
||||
if (rf_rx_num != 0)
|
||||
pPhyInfo->SignalStrength = (u8)(odm_SignalScaleMapping(dm_odm, total_rssi /= rf_rx_num));
|
||||
pPhyInfo->SignalStrength = (u8)(odm_signal_scale_mapping(dm_odm, total_rssi /= rf_rx_num));
|
||||
}
|
||||
|
||||
/* For 88E HW Antenna Diversity */
|
||||
|
@ -347,8 +347,3 @@ void ODM_PhyStatusQuery(struct odm_dm_struct *dm_odm,
|
|||
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)
|
||||
{
|
||||
return ODM_ReadAndConfig_RadioA_1T_8188E(dm_odm);
|
||||
}
|
||||
|
|
|
@ -1,89 +0,0 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/* Copyright(c) 2007 - 2011 Realtek Corporation. */
|
||||
|
||||
#include "../include/drv_types.h"
|
||||
|
||||
static void odm_ConfigRFReg_8188E(struct odm_dm_struct *pDM_Odm, u32 Addr,
|
||||
u32 Data, u32 RegAddr)
|
||||
{
|
||||
if (Addr == 0xffe) {
|
||||
msleep(50);
|
||||
} else if (Addr == 0xfd) {
|
||||
mdelay(5);
|
||||
} else if (Addr == 0xfc) {
|
||||
mdelay(1);
|
||||
} else if (Addr == 0xfb) {
|
||||
udelay(50);
|
||||
} else if (Addr == 0xfa) {
|
||||
udelay(5);
|
||||
} else if (Addr == 0xf9) {
|
||||
udelay(1);
|
||||
} else {
|
||||
rtl8188e_PHY_SetRFReg(pDM_Odm->Adapter, RegAddr, bRFRegOffsetMask, Data);
|
||||
/* Add 1us delay between BB/RF register setting. */
|
||||
udelay(1);
|
||||
}
|
||||
}
|
||||
|
||||
void odm_ConfigRF_RadioA_8188E(struct odm_dm_struct *pDM_Odm, u32 Addr, u32 Data)
|
||||
{
|
||||
u32 content = 0x1000; /* RF_Content: radioa_txt */
|
||||
u32 maskforPhySet = (u32)(content & 0xE000);
|
||||
|
||||
odm_ConfigRFReg_8188E(pDM_Odm, Addr, Data, Addr | maskforPhySet);
|
||||
}
|
||||
|
||||
void odm_ConfigMAC_8188E(struct odm_dm_struct *pDM_Odm, u32 Addr, u8 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)
|
||||
{
|
||||
rtl8188e_PHY_SetBBReg(pDM_Odm->Adapter, Addr, Bitmask, Data);
|
||||
/* Add 1us delay between BB/RF register setting. */
|
||||
udelay(1);
|
||||
}
|
||||
|
||||
void odm_ConfigBB_PHY_REG_PG_8188E(struct odm_dm_struct *pDM_Odm, u32 Addr,
|
||||
u32 Bitmask, u32 Data)
|
||||
{
|
||||
if (Addr == 0xfe)
|
||||
msleep(50);
|
||||
else if (Addr == 0xfd)
|
||||
mdelay(5);
|
||||
else if (Addr == 0xfc)
|
||||
mdelay(1);
|
||||
else if (Addr == 0xfb)
|
||||
udelay(50);
|
||||
else if (Addr == 0xfa)
|
||||
udelay(5);
|
||||
else if (Addr == 0xf9)
|
||||
udelay(1);
|
||||
else
|
||||
storePwrIndexDiffRateOffset(pDM_Odm->Adapter, Addr, Bitmask, Data);
|
||||
}
|
||||
|
||||
void odm_ConfigBB_PHY_8188E(struct odm_dm_struct *pDM_Odm, u32 Addr, u32 Bitmask, u32 Data)
|
||||
{
|
||||
if (Addr == 0xfe) {
|
||||
msleep(50);
|
||||
} else if (Addr == 0xfd) {
|
||||
mdelay(5);
|
||||
} else if (Addr == 0xfc) {
|
||||
mdelay(1);
|
||||
} else if (Addr == 0xfb) {
|
||||
udelay(50);
|
||||
} else if (Addr == 0xfa) {
|
||||
udelay(5);
|
||||
} else if (Addr == 0xf9) {
|
||||
udelay(1);
|
||||
} else {
|
||||
if (Addr == 0xa24)
|
||||
pDM_Odm->RFCalibrateInfo.RegA24 = Data;
|
||||
rtl8188e_PHY_SetBBReg(pDM_Odm->Adapter, Addr, Bitmask, Data);
|
||||
|
||||
/* Add 1us delay between BB/RF register setting. */
|
||||
udelay(1);
|
||||
}
|
||||
}
|
|
@ -5,8 +5,6 @@
|
|||
|
||||
#include "../include/osdep_service.h"
|
||||
#include "../include/drv_types.h"
|
||||
#include "../include/recv_osdep.h"
|
||||
#include "../include/mlme_osdep.h"
|
||||
#include "../include/rtw_ioctl_set.h"
|
||||
|
||||
#include "../include/rtl8188e_hal.h"
|
||||
|
|
|
@ -526,43 +526,38 @@ void rtl8188e_ReadEFuse(struct adapter *Adapter, u16 _size_byte, u8 *pbuf)
|
|||
Hal_EfuseReadEFuse88E(Adapter, 0, _size_byte, pbuf);
|
||||
}
|
||||
|
||||
static void dump_chip_info(struct HAL_VERSION chip_vers)
|
||||
static void dump_chip_info(struct adapter *adapter, struct HAL_VERSION chip_vers)
|
||||
{
|
||||
uint cnt = 0;
|
||||
char buf[128];
|
||||
|
||||
cnt += sprintf((buf + cnt), "Chip Version Info: CHIP_8188E_");
|
||||
cnt += sprintf((buf + cnt), "%s_", IS_NORMAL_CHIP(chip_vers) ?
|
||||
"Normal_Chip" : "Test_Chip");
|
||||
cnt += sprintf((buf + cnt), "%s_", IS_CHIP_VENDOR_TSMC(chip_vers) ?
|
||||
"TSMC" : "UMC");
|
||||
struct net_device *netdev = adapter->pnetdev;
|
||||
char *cut = NULL;
|
||||
char buf[25];
|
||||
|
||||
switch (chip_vers.CUTVersion) {
|
||||
case A_CUT_VERSION:
|
||||
cnt += sprintf((buf + cnt), "A_CUT_");
|
||||
cut = "A_CUT";
|
||||
break;
|
||||
case B_CUT_VERSION:
|
||||
cnt += sprintf((buf + cnt), "B_CUT_");
|
||||
cut = "B_CUT";
|
||||
break;
|
||||
case C_CUT_VERSION:
|
||||
cnt += sprintf((buf + cnt), "C_CUT_");
|
||||
cut = "C_CUT";
|
||||
break;
|
||||
case D_CUT_VERSION:
|
||||
cnt += sprintf((buf + cnt), "D_CUT_");
|
||||
cut = "D_CUT";
|
||||
break;
|
||||
case E_CUT_VERSION:
|
||||
cnt += sprintf((buf + cnt), "E_CUT_");
|
||||
cut = "E_CUT";
|
||||
break;
|
||||
default:
|
||||
cnt += sprintf((buf + cnt), "UNKNOWN_CUT(%d)_", chip_vers.CUTVersion);
|
||||
snprintf(buf, sizeof(buf), "UNKNOWN_CUT(%d)", chip_vers.CUTVersion);
|
||||
cut = buf;
|
||||
break;
|
||||
}
|
||||
|
||||
cnt += sprintf((buf + cnt), "1T1R_");
|
||||
|
||||
cnt += sprintf((buf + cnt), "RomVer(%d)\n", 0);
|
||||
|
||||
pr_info("%s", buf);
|
||||
netdev_dbg(netdev, "Chip Version Info: CHIP_8188E_%s_%s_%s_1T1R_RomVer(%d)\n",
|
||||
IS_NORMAL_CHIP(chip_vers) ? "Normal_Chip" : "Test_Chip",
|
||||
IS_CHIP_VENDOR_TSMC(chip_vers) ? "TSMC" : "UMC",
|
||||
cut, 0);
|
||||
}
|
||||
|
||||
void rtl8188e_read_chip_version(struct adapter *padapter)
|
||||
|
@ -581,7 +576,7 @@ void rtl8188e_read_chip_version(struct adapter *padapter)
|
|||
ChipVersion.VendorType = ((value32 & VENDOR_ID) ? CHIP_VENDOR_UMC : CHIP_VENDOR_TSMC);
|
||||
ChipVersion.CUTVersion = (value32 & CHIP_VER_RTL_MASK) >> CHIP_VER_RTL_SHIFT; /* IC version (CUT) */
|
||||
|
||||
dump_chip_info(ChipVersion);
|
||||
dump_chip_info(padapter, ChipVersion);
|
||||
|
||||
pHalData->VersionID = ChipVersion;
|
||||
}
|
||||
|
@ -688,6 +683,7 @@ Hal_EfuseParseIDCode88E(
|
|||
)
|
||||
{
|
||||
struct eeprom_priv *pEEPROM = &padapter->eeprompriv;
|
||||
struct net_device *netdev = padapter->pnetdev;
|
||||
u16 EEPROMId;
|
||||
|
||||
/* Check 0x8129 again for making sure autoload status!! */
|
||||
|
@ -699,7 +695,7 @@ Hal_EfuseParseIDCode88E(
|
|||
pEEPROM->bautoload_fail_flag = false;
|
||||
}
|
||||
|
||||
pr_info("EEPROM ID = 0x%04x\n", EEPROMId);
|
||||
netdev_dbg(netdev, "EEPROM ID = 0x%04x\n", EEPROMId);
|
||||
}
|
||||
|
||||
static void Hal_ReadPowerValueFromPROM_8188E(struct txpowerinfo24g *pwrInfo24G, u8 *PROMContent, bool AutoLoadFail)
|
||||
|
|
|
@ -12,26 +12,12 @@
|
|||
/* 1. BB register R/W API */
|
||||
/* */
|
||||
|
||||
/**
|
||||
* Function: phy_CalculateBitShift
|
||||
*
|
||||
* OverView: Get shifted position of the BitMask
|
||||
*
|
||||
* Input:
|
||||
* u32 BitMask,
|
||||
*
|
||||
* Output: none
|
||||
* Return: u32 Return the shift bit bit position of the mask
|
||||
*/
|
||||
static u32 phy_CalculateBitShift(u32 BitMask)
|
||||
/* Get shifted position of the bit mask */
|
||||
static u32 phy_calculate_bit_shift(u32 bitmask)
|
||||
{
|
||||
u32 i;
|
||||
u32 i = ffs(bitmask);
|
||||
|
||||
for (i = 0; i <= 31; i++) {
|
||||
if (((BitMask >> i) & 0x1) == 1)
|
||||
break;
|
||||
}
|
||||
return i;
|
||||
return i ? i - 1 : 32;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -62,7 +48,7 @@ rtl8188e_PHY_QueryBBReg(
|
|||
if (res)
|
||||
return 0;
|
||||
|
||||
BitShift = phy_CalculateBitShift(BitMask);
|
||||
BitShift = phy_calculate_bit_shift(BitMask);
|
||||
ReturnValue = (OriginalValue & BitMask) >> BitShift;
|
||||
return ReturnValue;
|
||||
}
|
||||
|
@ -95,7 +81,7 @@ void rtl8188e_PHY_SetBBReg(struct adapter *Adapter, u32 RegAddr, u32 BitMask, u3
|
|||
if (res)
|
||||
return;
|
||||
|
||||
BitShift = phy_CalculateBitShift(BitMask);
|
||||
BitShift = phy_calculate_bit_shift(BitMask);
|
||||
Data = ((OriginalValue & (~BitMask)) | (Data << BitShift));
|
||||
}
|
||||
|
||||
|
@ -267,7 +253,7 @@ u32 rtl8188e_PHY_QueryRFReg(struct adapter *Adapter, u32 RegAddr, u32 BitMask)
|
|||
|
||||
Original_Value = phy_RFSerialRead(Adapter, RegAddr);
|
||||
|
||||
BitShift = phy_CalculateBitShift(BitMask);
|
||||
BitShift = phy_calculate_bit_shift(BitMask);
|
||||
Readback_Value = (Original_Value & BitMask) >> BitShift;
|
||||
return Readback_Value;
|
||||
}
|
||||
|
@ -302,7 +288,7 @@ rtl8188e_PHY_SetRFReg(
|
|||
/* RF data is 12 bits only */
|
||||
if (BitMask != bRFRegOffsetMask) {
|
||||
Original_Value = phy_RFSerialRead(Adapter, RegAddr);
|
||||
BitShift = phy_CalculateBitShift(BitMask);
|
||||
BitShift = phy_calculate_bit_shift(BitMask);
|
||||
Data = ((Original_Value & (~BitMask)) | (Data << BitShift));
|
||||
}
|
||||
|
||||
|
@ -337,7 +323,7 @@ s32 PHY_MACConfig8188E(struct adapter *Adapter)
|
|||
/* */
|
||||
/* Config MAC */
|
||||
/* */
|
||||
if (HAL_STATUS_FAILURE == ODM_ReadAndConfig_MAC_REG_8188E(&pHalData->odmpriv))
|
||||
if (ODM_ReadAndConfig_MAC_REG_8188E(&pHalData->odmpriv))
|
||||
rtStatus = _FAIL;
|
||||
|
||||
/* 2010.07.13 AMPDU aggregation number B */
|
||||
|
@ -469,7 +455,7 @@ static int phy_BB8188E_Config_ParaFile(struct adapter *Adapter)
|
|||
/* 1. Read PHY_REG.TXT BB INIT!! */
|
||||
/* We will separate as 88C / 92C according to chip version */
|
||||
/* */
|
||||
if (HAL_STATUS_FAILURE == ODM_ReadAndConfig_PHY_REG_1T_8188E(&pHalData->odmpriv))
|
||||
if (ODM_ReadAndConfig_PHY_REG_1T_8188E(&pHalData->odmpriv))
|
||||
return _FAIL;
|
||||
|
||||
/* 2. If EEPROM or EFUSE autoload OK, We must config by PHY_REG_PG.txt */
|
||||
|
@ -479,7 +465,7 @@ static int phy_BB8188E_Config_ParaFile(struct adapter *Adapter)
|
|||
}
|
||||
|
||||
/* 3. BB AGC table Initialization */
|
||||
if (HAL_STATUS_FAILURE == ODM_ReadAndConfig_AGC_TAB_1T_8188E(&pHalData->odmpriv))
|
||||
if (ODM_ReadAndConfig_AGC_TAB_1T_8188E(&pHalData->odmpriv))
|
||||
return _FAIL;
|
||||
|
||||
return _SUCCESS;
|
||||
|
@ -521,15 +507,6 @@ PHY_BBConfig8188E(
|
|||
return rtStatus;
|
||||
}
|
||||
|
||||
int PHY_RFConfig8188E(struct adapter *Adapter)
|
||||
{
|
||||
int rtStatus = _SUCCESS;
|
||||
|
||||
/* RF config */
|
||||
rtStatus = PHY_RF6052_Config8188E(Adapter);
|
||||
return rtStatus;
|
||||
}
|
||||
|
||||
static void getTxPowerIndex88E(struct adapter *Adapter, u8 channel, u8 *cckPowerLevel,
|
||||
u8 *ofdmPowerLevel, u8 *BW20PowerLevel,
|
||||
u8 *BW40PowerLevel)
|
||||
|
|
|
@ -366,7 +366,7 @@ rtl8188e_PHY_RF6052SetOFDMTxPower(
|
|||
}
|
||||
}
|
||||
|
||||
static int phy_RF6052_Config_ParaFile(struct adapter *Adapter)
|
||||
int phy_RF6052_Config_ParaFile(struct adapter *Adapter)
|
||||
{
|
||||
struct bb_reg_def *pPhyReg;
|
||||
struct hal_data_8188e *pHalData = &Adapter->haldata;
|
||||
|
@ -396,7 +396,7 @@ static int phy_RF6052_Config_ParaFile(struct adapter *Adapter)
|
|||
udelay(1);/* PlatformStallExecution(1); */
|
||||
|
||||
/*----Initialize RF fom connfiguration file----*/
|
||||
if (HAL_STATUS_FAILURE == ODM_ConfigRFWithHeaderFile(&pHalData->odmpriv))
|
||||
if (ODM_ReadAndConfig_RadioA_1T_8188E(&pHalData->odmpriv))
|
||||
rtStatus = _FAIL;
|
||||
|
||||
/*----Restore RFENV control type----*/;
|
||||
|
@ -404,14 +404,3 @@ static int phy_RF6052_Config_ParaFile(struct adapter *Adapter)
|
|||
|
||||
return rtStatus;
|
||||
}
|
||||
|
||||
int PHY_RF6052_Config8188E(struct adapter *Adapter)
|
||||
{
|
||||
int rtStatus = _SUCCESS;
|
||||
|
||||
/* */
|
||||
/* Config BB and RF */
|
||||
/* */
|
||||
rtStatus = phy_RF6052_Config_ParaFile(Adapter);
|
||||
return rtStatus;
|
||||
}
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/* Copyright(c) 2007 - 2011 Realtek Corporation. */
|
||||
|
||||
#define _RTL8188E_XMIT_C_
|
||||
|
||||
#include "../include/osdep_service.h"
|
||||
#include "../include/drv_types.h"
|
||||
#include "../include/rtl8188e_hal.h"
|
||||
|
||||
void handle_txrpt_ccx_88e(struct adapter *adapter, u8 *buf)
|
||||
{
|
||||
struct txrpt_ccx_88e *txrpt_ccx = (struct txrpt_ccx_88e *)buf;
|
||||
|
||||
if (txrpt_ccx->int_ccx) {
|
||||
if (txrpt_ccx->pkt_ok)
|
||||
rtw_ack_tx_done(&adapter->xmitpriv,
|
||||
RTW_SCTX_DONE_SUCCESS);
|
||||
else
|
||||
rtw_ack_tx_done(&adapter->xmitpriv,
|
||||
RTW_SCTX_DONE_CCX_PKT_FAIL);
|
||||
}
|
||||
}
|
|
@ -1,91 +0,0 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/* Copyright(c) 2007 - 2011 Realtek Corporation. */
|
||||
|
||||
#define _RTL8188EU_RECV_C_
|
||||
#include "../include/osdep_service.h"
|
||||
#include "../include/drv_types.h"
|
||||
#include "../include/recv_osdep.h"
|
||||
#include "../include/mlme_osdep.h"
|
||||
|
||||
#include "../include/usb_ops.h"
|
||||
#include "../include/wifi.h"
|
||||
|
||||
#include "../include/rtl8188e_hal.h"
|
||||
|
||||
int rtl8188eu_init_recv_priv(struct adapter *padapter)
|
||||
{
|
||||
struct recv_priv *precvpriv = &padapter->recvpriv;
|
||||
int i, res = _SUCCESS;
|
||||
struct recv_buf *precvbuf;
|
||||
|
||||
tasklet_init(&precvpriv->recv_tasklet,
|
||||
rtl8188eu_recv_tasklet,
|
||||
(unsigned long)padapter);
|
||||
|
||||
/* init recv_buf */
|
||||
rtw_init_queue(&precvpriv->free_recv_buf_queue);
|
||||
|
||||
precvpriv->pallocated_recv_buf = kzalloc(NR_RECVBUFF * sizeof(struct recv_buf) + 4,
|
||||
GFP_KERNEL);
|
||||
if (!precvpriv->pallocated_recv_buf) {
|
||||
res = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
precvpriv->precv_buf = (u8 *)ALIGN((size_t)(precvpriv->pallocated_recv_buf), 4);
|
||||
|
||||
precvbuf = (struct recv_buf *)precvpriv->precv_buf;
|
||||
|
||||
for (i = 0; i < NR_RECVBUFF; i++) {
|
||||
res = rtw_os_recvbuf_resource_alloc(padapter, precvbuf);
|
||||
if (res == _FAIL)
|
||||
break;
|
||||
precvbuf->adapter = padapter;
|
||||
precvbuf++;
|
||||
}
|
||||
precvpriv->free_recv_buf_queue_cnt = NR_RECVBUFF;
|
||||
skb_queue_head_init(&precvpriv->rx_skb_queue);
|
||||
{
|
||||
int i;
|
||||
size_t tmpaddr = 0;
|
||||
size_t alignment = 0;
|
||||
struct sk_buff *pskb = NULL;
|
||||
|
||||
skb_queue_head_init(&precvpriv->free_recv_skb_queue);
|
||||
|
||||
for (i = 0; i < NR_PREALLOC_RECV_SKB; i++) {
|
||||
pskb = __netdev_alloc_skb(padapter->pnetdev, MAX_RECVBUF_SZ + RECVBUFF_ALIGN_SZ, GFP_KERNEL);
|
||||
if (pskb) {
|
||||
pskb->dev = padapter->pnetdev;
|
||||
tmpaddr = (size_t)pskb->data;
|
||||
alignment = tmpaddr & (RECVBUFF_ALIGN_SZ - 1);
|
||||
skb_reserve(pskb, (RECVBUFF_ALIGN_SZ - alignment));
|
||||
|
||||
skb_queue_tail(&precvpriv->free_recv_skb_queue, pskb);
|
||||
}
|
||||
pskb = NULL;
|
||||
}
|
||||
}
|
||||
exit:
|
||||
return res;
|
||||
}
|
||||
|
||||
void rtl8188eu_free_recv_priv(struct adapter *padapter)
|
||||
{
|
||||
int i;
|
||||
struct recv_buf *precvbuf;
|
||||
struct recv_priv *precvpriv = &padapter->recvpriv;
|
||||
|
||||
precvbuf = (struct recv_buf *)precvpriv->precv_buf;
|
||||
|
||||
for (i = 0; i < NR_RECVBUFF; i++) {
|
||||
rtw_os_recvbuf_resource_free(padapter, precvbuf);
|
||||
precvbuf++;
|
||||
}
|
||||
|
||||
kfree(precvpriv->pallocated_recv_buf);
|
||||
|
||||
skb_queue_purge(&precvpriv->rx_skb_queue);
|
||||
|
||||
skb_queue_purge(&precvpriv->free_recv_skb_queue);
|
||||
}
|
|
@ -431,7 +431,7 @@ bool rtl8188eu_xmitframe_complete(struct adapter *adapt, struct xmit_priv *pxmit
|
|||
rtw_xmitframe_coalesce(adapt, pxmitframe->pkt, pxmitframe);
|
||||
|
||||
/* always return ndis_packet after rtw_xmitframe_coalesce */
|
||||
rtw_os_xmit_complete(adapt, pxmitframe);
|
||||
rtw_xmit_complete(adapt, pxmitframe);
|
||||
|
||||
/* 3 2. aggregate same priority and same DA(AP or STA) frames */
|
||||
pfirstframe = pxmitframe;
|
||||
|
@ -501,7 +501,7 @@ bool rtl8188eu_xmitframe_complete(struct adapter *adapt, struct xmit_priv *pxmit
|
|||
|
||||
rtw_xmitframe_coalesce(adapt, pxmitframe->pkt, pxmitframe);
|
||||
/* always return ndis_packet after rtw_xmitframe_coalesce */
|
||||
rtw_os_xmit_complete(adapt, pxmitframe);
|
||||
rtw_xmit_complete(adapt, pxmitframe);
|
||||
|
||||
/* (len - TXDESC_SIZE) == pxmitframe->attrib.last_txcmdsz */
|
||||
update_txdesc(pxmitframe, pxmitframe->buf_addr, pxmitframe->attrib.last_txcmdsz, true);
|
||||
|
|
|
@ -13,40 +13,77 @@
|
|||
#include "../include/usb_osintf.h"
|
||||
#include "../include/HalPwrSeqCmd.h"
|
||||
|
||||
static void _ConfigNormalChipOutEP_8188E(struct adapter *adapt, u8 NumOutPipe)
|
||||
static void one_out_pipe(struct adapter *adapter)
|
||||
{
|
||||
struct hal_data_8188e *haldata = &adapt->haldata;
|
||||
struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(adapter);
|
||||
|
||||
switch (NumOutPipe) {
|
||||
case 3:
|
||||
haldata->OutEpQueueSel = TX_SELE_HQ | TX_SELE_LQ | TX_SELE_NQ;
|
||||
haldata->OutEpNumber = 3;
|
||||
break;
|
||||
case 2:
|
||||
haldata->OutEpQueueSel = TX_SELE_HQ | TX_SELE_NQ;
|
||||
haldata->OutEpNumber = 2;
|
||||
break;
|
||||
case 1:
|
||||
haldata->OutEpQueueSel = TX_SELE_HQ;
|
||||
haldata->OutEpNumber = 1;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
pdvobjpriv->Queue2Pipe[0] = pdvobjpriv->RtOutPipe[0];/* VO */
|
||||
pdvobjpriv->Queue2Pipe[1] = pdvobjpriv->RtOutPipe[0];/* VI */
|
||||
pdvobjpriv->Queue2Pipe[2] = pdvobjpriv->RtOutPipe[0];/* BE */
|
||||
pdvobjpriv->Queue2Pipe[3] = pdvobjpriv->RtOutPipe[0];/* BK */
|
||||
}
|
||||
|
||||
static void two_out_pipe(struct adapter *adapter, bool wifi_cfg)
|
||||
{
|
||||
struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(adapter);
|
||||
|
||||
/* 0:H, 1:L */
|
||||
|
||||
pdvobjpriv->Queue2Pipe[1] = pdvobjpriv->RtOutPipe[0];/* VI */
|
||||
pdvobjpriv->Queue2Pipe[2] = pdvobjpriv->RtOutPipe[1];/* BE */
|
||||
|
||||
if (wifi_cfg) {
|
||||
pdvobjpriv->Queue2Pipe[0] = pdvobjpriv->RtOutPipe[1];/* VO */
|
||||
pdvobjpriv->Queue2Pipe[3] = pdvobjpriv->RtOutPipe[0];/* BK */
|
||||
} else {
|
||||
pdvobjpriv->Queue2Pipe[0] = pdvobjpriv->RtOutPipe[0];/* VO */
|
||||
pdvobjpriv->Queue2Pipe[3] = pdvobjpriv->RtOutPipe[1];/* BK */
|
||||
}
|
||||
}
|
||||
|
||||
static bool HalUsbSetQueuePipeMapping8188EUsb(struct adapter *adapt, u8 NumOutPipe)
|
||||
static void three_out_pipe(struct adapter *adapter, bool wifi_cfg)
|
||||
{
|
||||
struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(adapter);
|
||||
|
||||
_ConfigNormalChipOutEP_8188E(adapt, NumOutPipe);
|
||||
return Hal_MappingOutPipe(adapt, NumOutPipe);
|
||||
/* 0:H, 1:N, 2:L */
|
||||
|
||||
pdvobjpriv->Queue2Pipe[0] = pdvobjpriv->RtOutPipe[0];/* VO */
|
||||
pdvobjpriv->Queue2Pipe[1] = pdvobjpriv->RtOutPipe[1];/* VI */
|
||||
pdvobjpriv->Queue2Pipe[2] = pdvobjpriv->RtOutPipe[2];/* BE */
|
||||
|
||||
pdvobjpriv->Queue2Pipe[3] = wifi_cfg ?
|
||||
pdvobjpriv->RtOutPipe[1] : pdvobjpriv->RtOutPipe[2];/* BK */
|
||||
}
|
||||
|
||||
void rtl8188eu_interface_configure(struct adapter *adapt)
|
||||
int rtl8188eu_interface_configure(struct adapter *adapt)
|
||||
{
|
||||
struct registry_priv *pregistrypriv = &adapt->registrypriv;
|
||||
struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(adapt);
|
||||
struct hal_data_8188e *haldata = &adapt->haldata;
|
||||
bool wifi_cfg = pregistrypriv->wifi_spec;
|
||||
|
||||
HalUsbSetQueuePipeMapping8188EUsb(adapt, pdvobjpriv->RtNumOutPipes);
|
||||
pdvobjpriv->Queue2Pipe[4] = pdvobjpriv->RtOutPipe[0];/* BCN */
|
||||
pdvobjpriv->Queue2Pipe[5] = pdvobjpriv->RtOutPipe[0];/* MGT */
|
||||
pdvobjpriv->Queue2Pipe[6] = pdvobjpriv->RtOutPipe[0];/* HIGH */
|
||||
pdvobjpriv->Queue2Pipe[7] = pdvobjpriv->RtOutPipe[0];/* TXCMD */
|
||||
|
||||
switch (pdvobjpriv->RtNumOutPipes) {
|
||||
case 3:
|
||||
haldata->out_ep_extra_queues = TX_SELE_LQ | TX_SELE_NQ;
|
||||
three_out_pipe(adapt, wifi_cfg);
|
||||
break;
|
||||
case 2:
|
||||
haldata->out_ep_extra_queues = TX_SELE_NQ;
|
||||
two_out_pipe(adapt, wifi_cfg);
|
||||
break;
|
||||
case 1:
|
||||
one_out_pipe(adapt);
|
||||
break;
|
||||
default:
|
||||
return -ENXIO;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
u32 rtl8188eu_InitPowerOn(struct adapter *adapt)
|
||||
|
@ -116,32 +153,24 @@ static void _InitQueueReservedPage(struct adapter *Adapter)
|
|||
{
|
||||
struct hal_data_8188e *haldata = &Adapter->haldata;
|
||||
struct registry_priv *pregistrypriv = &Adapter->registrypriv;
|
||||
u32 numHQ = 0;
|
||||
u32 numLQ = 0;
|
||||
u32 numNQ = 0;
|
||||
u32 numPubQ;
|
||||
u32 value32;
|
||||
u8 value8;
|
||||
bool bWiFiConfig = pregistrypriv->wifi_spec;
|
||||
u8 numLQ = 0;
|
||||
u8 numNQ = 0;
|
||||
u8 numPubQ;
|
||||
|
||||
if (bWiFiConfig) {
|
||||
if (haldata->OutEpQueueSel & TX_SELE_HQ)
|
||||
numHQ = 0x29;
|
||||
|
||||
if (haldata->OutEpQueueSel & TX_SELE_LQ)
|
||||
if (pregistrypriv->wifi_spec) {
|
||||
if (haldata->out_ep_extra_queues & TX_SELE_LQ)
|
||||
numLQ = 0x1C;
|
||||
|
||||
/* NOTE: This step shall be proceed before writing REG_RQPN. */
|
||||
if (haldata->OutEpQueueSel & TX_SELE_NQ)
|
||||
if (haldata->out_ep_extra_queues & TX_SELE_NQ)
|
||||
numNQ = 0x1C;
|
||||
value8 = (u8)_NPQ(numNQ);
|
||||
rtw_write8(Adapter, REG_RQPN_NPQ, value8);
|
||||
|
||||
numPubQ = 0xA8 - numHQ - numLQ - numNQ;
|
||||
rtw_write8(Adapter, REG_RQPN_NPQ, numNQ);
|
||||
|
||||
numPubQ = 0xA8 - NUM_HQ - numLQ - numNQ;
|
||||
|
||||
/* TX DMA */
|
||||
value32 = _HPQ(numHQ) | _LPQ(numLQ) | _PUBQ(numPubQ) | LD_RQPN;
|
||||
rtw_write32(Adapter, REG_RQPN, value32);
|
||||
rtw_write32(Adapter, REG_RQPN, LD_RQPN | numPubQ << 16 | numLQ << 8 | NUM_HQ);
|
||||
} else {
|
||||
rtw_write16(Adapter, REG_RQPN_NPQ, 0x0000);/* Just follow MP Team,??? Georgia 03/28 */
|
||||
rtw_write16(Adapter, REG_RQPN_NPQ, 0x0d);
|
||||
|
@ -187,69 +216,20 @@ static void _InitNormalChipRegPriority(struct adapter *Adapter, u16 beQ,
|
|||
rtw_write16(Adapter, REG_TRXDMA_CTRL, value16);
|
||||
}
|
||||
|
||||
static void _InitNormalChipOneOutEpPriority(struct adapter *Adapter)
|
||||
{
|
||||
struct hal_data_8188e *haldata = &Adapter->haldata;
|
||||
|
||||
u16 value = 0;
|
||||
switch (haldata->OutEpQueueSel) {
|
||||
case TX_SELE_HQ:
|
||||
value = QUEUE_HIGH;
|
||||
break;
|
||||
case TX_SELE_LQ:
|
||||
value = QUEUE_LOW;
|
||||
break;
|
||||
case TX_SELE_NQ:
|
||||
value = QUEUE_NORMAL;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
_InitNormalChipRegPriority(Adapter, value, value, value, value,
|
||||
value, value);
|
||||
}
|
||||
|
||||
static void _InitNormalChipTwoOutEpPriority(struct adapter *Adapter)
|
||||
{
|
||||
struct hal_data_8188e *haldata = &Adapter->haldata;
|
||||
struct registry_priv *pregistrypriv = &Adapter->registrypriv;
|
||||
u16 beQ, bkQ, viQ, voQ, mgtQ, hiQ;
|
||||
u16 valueHi = 0;
|
||||
u16 valueLow = 0;
|
||||
|
||||
switch (haldata->OutEpQueueSel) {
|
||||
case (TX_SELE_HQ | TX_SELE_LQ):
|
||||
valueHi = QUEUE_HIGH;
|
||||
valueLow = QUEUE_LOW;
|
||||
break;
|
||||
case (TX_SELE_NQ | TX_SELE_LQ):
|
||||
valueHi = QUEUE_NORMAL;
|
||||
valueLow = QUEUE_LOW;
|
||||
break;
|
||||
case (TX_SELE_HQ | TX_SELE_NQ):
|
||||
valueHi = QUEUE_HIGH;
|
||||
valueLow = QUEUE_NORMAL;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
u16 bkQ, voQ;
|
||||
|
||||
if (!pregistrypriv->wifi_spec) {
|
||||
beQ = valueLow;
|
||||
bkQ = valueLow;
|
||||
viQ = valueHi;
|
||||
voQ = valueHi;
|
||||
mgtQ = valueHi;
|
||||
hiQ = valueHi;
|
||||
bkQ = QUEUE_NORMAL;
|
||||
voQ = QUEUE_HIGH;
|
||||
} else {/* for WMM ,CONFIG_OUT_EP_WIFI_MODE */
|
||||
beQ = valueLow;
|
||||
bkQ = valueHi;
|
||||
viQ = valueHi;
|
||||
voQ = valueLow;
|
||||
mgtQ = valueHi;
|
||||
hiQ = valueHi;
|
||||
bkQ = QUEUE_HIGH;
|
||||
voQ = QUEUE_NORMAL;
|
||||
}
|
||||
_InitNormalChipRegPriority(Adapter, beQ, bkQ, viQ, voQ, mgtQ, hiQ);
|
||||
_InitNormalChipRegPriority(Adapter, QUEUE_NORMAL, bkQ, QUEUE_HIGH,
|
||||
voQ, QUEUE_HIGH, QUEUE_HIGH);
|
||||
}
|
||||
|
||||
static void _InitNormalChipThreeOutEpPriority(struct adapter *Adapter)
|
||||
|
@ -277,11 +257,12 @@ static void _InitNormalChipThreeOutEpPriority(struct adapter *Adapter)
|
|||
|
||||
static void _InitQueuePriority(struct adapter *Adapter)
|
||||
{
|
||||
struct hal_data_8188e *haldata = &Adapter->haldata;
|
||||
struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(Adapter);
|
||||
|
||||
switch (haldata->OutEpNumber) {
|
||||
switch (pdvobjpriv->RtNumOutPipes) {
|
||||
case 1:
|
||||
_InitNormalChipOneOutEpPriority(Adapter);
|
||||
_InitNormalChipRegPriority(Adapter, QUEUE_HIGH, QUEUE_HIGH, QUEUE_HIGH,
|
||||
QUEUE_HIGH, QUEUE_HIGH, QUEUE_HIGH);
|
||||
break;
|
||||
case 2:
|
||||
_InitNormalChipTwoOutEpPriority(Adapter);
|
||||
|
@ -515,8 +496,7 @@ static int _InitBeaconParameters(struct adapter *Adapter)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void _BeaconFunctionEnable(struct adapter *Adapter,
|
||||
bool Enable, bool Linked)
|
||||
static void _BeaconFunctionEnable(struct adapter *Adapter)
|
||||
{
|
||||
rtw_write8(Adapter, REG_BCN_CTRL, (BIT(4) | BIT(3) | BIT(1)));
|
||||
|
||||
|
@ -567,7 +547,6 @@ u32 rtl8188eu_hal_init(struct adapter *Adapter)
|
|||
{
|
||||
u8 value8 = 0;
|
||||
u16 value16;
|
||||
u8 txpktbuf_bndy;
|
||||
u32 status = _SUCCESS;
|
||||
int res;
|
||||
struct hal_data_8188e *haldata = &Adapter->haldata;
|
||||
|
@ -600,13 +579,6 @@ u32 rtl8188eu_hal_init(struct adapter *Adapter)
|
|||
/* HW GPIO pin. Before PHY_RFConfig8192C. */
|
||||
/* 2010/08/26 MH If Efuse does not support sective suspend then disable the function. */
|
||||
|
||||
if (!pregistrypriv->wifi_spec) {
|
||||
txpktbuf_bndy = TX_PAGE_BOUNDARY_88E;
|
||||
} else {
|
||||
/* for WMM */
|
||||
txpktbuf_bndy = WMM_NORMAL_TX_PAGE_BOUNDARY_88E;
|
||||
}
|
||||
|
||||
_InitQueueReservedPage(Adapter);
|
||||
_InitQueuePriority(Adapter);
|
||||
_InitPageBoundary(Adapter);
|
||||
|
@ -639,7 +611,7 @@ u32 rtl8188eu_hal_init(struct adapter *Adapter)
|
|||
if (status == _FAIL)
|
||||
goto exit;
|
||||
|
||||
status = PHY_RFConfig8188E(Adapter);
|
||||
status = phy_RF6052_Config_ParaFile(Adapter);
|
||||
if (status == _FAIL)
|
||||
goto exit;
|
||||
|
||||
|
@ -647,9 +619,9 @@ u32 rtl8188eu_hal_init(struct adapter *Adapter)
|
|||
if (status == _FAIL)
|
||||
goto exit;
|
||||
|
||||
_InitTxBufferBoundary(Adapter, txpktbuf_bndy);
|
||||
_InitTxBufferBoundary(Adapter, TX_PAGE_BOUNDARY_88E);
|
||||
|
||||
status = InitLLTTable(Adapter, txpktbuf_bndy);
|
||||
status = InitLLTTable(Adapter, TX_PAGE_BOUNDARY_88E);
|
||||
if (status == _FAIL)
|
||||
goto exit;
|
||||
|
||||
|
@ -922,7 +894,7 @@ static void Hal_EfuseParseMACAddr_8188EU(struct adapter *adapt, u8 *hwinfo, bool
|
|||
}
|
||||
}
|
||||
|
||||
void ReadAdapterInfo8188EU(struct adapter *Adapter)
|
||||
int ReadAdapterInfo8188EU(struct adapter *Adapter)
|
||||
{
|
||||
struct eeprom_priv *eeprom = &Adapter->eeprompriv;
|
||||
struct led_priv *ledpriv = &Adapter->ledpriv;
|
||||
|
@ -933,13 +905,13 @@ void ReadAdapterInfo8188EU(struct adapter *Adapter)
|
|||
/* check system boot selection */
|
||||
res = rtw_read8(Adapter, REG_9346CR, &eeValue);
|
||||
if (res)
|
||||
return;
|
||||
return res;
|
||||
|
||||
eeprom->bautoload_fail_flag = !(eeValue & EEPROM_EN);
|
||||
|
||||
efuse_buf = kmalloc(EFUSE_MAP_LEN_88E, GFP_KERNEL);
|
||||
if (!efuse_buf)
|
||||
return;
|
||||
return -ENOMEM;
|
||||
memset(efuse_buf, 0xFF, EFUSE_MAP_LEN_88E);
|
||||
|
||||
if (!(eeValue & BOOT_FROM_EEPROM) && !eeprom->bautoload_fail_flag) {
|
||||
|
@ -961,6 +933,7 @@ void ReadAdapterInfo8188EU(struct adapter *Adapter)
|
|||
|
||||
ledpriv->bRegUseLed = true;
|
||||
kfree(efuse_buf);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void UpdateHalRAMask8188EUsb(struct adapter *adapt, u32 mac_id, u8 rssi_level)
|
||||
|
@ -1069,7 +1042,7 @@ void SetBeaconRelatedRegisters8188EUsb(struct adapter *adapt)
|
|||
rtw_write8(adapt, REG_RXTSF_OFFSET_CCK, 0x50);
|
||||
rtw_write8(adapt, REG_RXTSF_OFFSET_OFDM, 0x50);
|
||||
|
||||
_BeaconFunctionEnable(adapt, true, true);
|
||||
_BeaconFunctionEnable(adapt);
|
||||
|
||||
rtw_resume_tx_beacon(adapt);
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
#include "../include/drv_types.h"
|
||||
#include "../include/osdep_intf.h"
|
||||
#include "../include/usb_ops.h"
|
||||
#include "../include/recv_osdep.h"
|
||||
#include "../include/rtl8188e_hal.h"
|
||||
|
||||
static int usb_read(struct intf_hdl *intf, u16 value, void *data, u8 size)
|
||||
|
@ -190,6 +189,20 @@ int rtw_writeN(struct adapter *adapter, u32 addr, u32 length, u8 *data)
|
|||
return RTW_STATUS_CODE(ret);
|
||||
}
|
||||
|
||||
static void handle_txrpt_ccx_88e(struct adapter *adapter, u8 *buf)
|
||||
{
|
||||
struct txrpt_ccx_88e *txrpt_ccx = (struct txrpt_ccx_88e *)buf;
|
||||
|
||||
if (txrpt_ccx->int_ccx) {
|
||||
if (txrpt_ccx->pkt_ok)
|
||||
rtw_ack_tx_done(&adapter->xmitpriv,
|
||||
RTW_SCTX_DONE_SUCCESS);
|
||||
else
|
||||
rtw_ack_tx_done(&adapter->xmitpriv,
|
||||
RTW_SCTX_DONE_CCX_PKT_FAIL);
|
||||
}
|
||||
}
|
||||
|
||||
static int recvbuf2recvframe(struct adapter *adapt, struct sk_buff *pskb)
|
||||
{
|
||||
u8 *pbuf;
|
||||
|
|
|
@ -80,7 +80,6 @@ void rtl8188e_PHY_SetRFReg(struct adapter *adapter, u32 regaddr, u32 mask, u32 d
|
|||
/* MAC/BB/RF HAL config */
|
||||
int PHY_MACConfig8188E(struct adapter *adapter);
|
||||
int PHY_BBConfig8188E(struct adapter *adapter);
|
||||
int PHY_RFConfig8188E(struct adapter *adapter);
|
||||
|
||||
/* BB TX Power R/W */
|
||||
void PHY_SetTxPowerLevel8188E(struct adapter *adapter, u8 channel);
|
||||
|
|
|
@ -10,13 +10,13 @@
|
|||
* AGC_TAB_1T.TXT
|
||||
******************************************************************************/
|
||||
|
||||
enum HAL_STATUS ODM_ReadAndConfig_AGC_TAB_1T_8188E(struct odm_dm_struct *odm);
|
||||
int ODM_ReadAndConfig_AGC_TAB_1T_8188E(struct odm_dm_struct *odm);
|
||||
|
||||
/******************************************************************************
|
||||
* PHY_REG_1T.TXT
|
||||
******************************************************************************/
|
||||
|
||||
enum HAL_STATUS ODM_ReadAndConfig_PHY_REG_1T_8188E(struct odm_dm_struct *odm);
|
||||
int ODM_ReadAndConfig_PHY_REG_1T_8188E(struct odm_dm_struct *odm);
|
||||
|
||||
/******************************************************************************
|
||||
* PHY_REG_PG.TXT
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
/******************************************************************************
|
||||
* MAC_REG.TXT
|
||||
******************************************************************************/
|
||||
|
||||
enum HAL_STATUS ODM_ReadAndConfig_MAC_REG_8188E(struct odm_dm_struct *pDM_Odm);
|
||||
int ODM_ReadAndConfig_MAC_REG_8188E(struct odm_dm_struct *pDM_Odm);
|
||||
|
||||
#endif /* end of HWIMG_SUPPORT */
|
||||
|
|
|
@ -8,6 +8,6 @@
|
|||
* RadioA_1T.TXT
|
||||
******************************************************************************/
|
||||
|
||||
enum HAL_STATUS ODM_ReadAndConfig_RadioA_1T_8188E(struct odm_dm_struct *odm);
|
||||
int ODM_ReadAndConfig_RadioA_1T_8188E(struct odm_dm_struct *odm);
|
||||
|
||||
#endif /* end of HWIMG_SUPPORT */
|
||||
|
|
|
@ -10,8 +10,6 @@
|
|||
#ifndef __DRV_TYPES_H__
|
||||
#define __DRV_TYPES_H__
|
||||
|
||||
#define DRV_NAME "r8188eu"
|
||||
|
||||
#include "osdep_service.h"
|
||||
#include "wlan_bssdef.h"
|
||||
#include "rtw_ht.h"
|
||||
|
@ -36,10 +34,9 @@
|
|||
#include "rtl8188e_hal.h"
|
||||
#include "rtw_fw.h"
|
||||
|
||||
#define DRIVERVERSION "v4.1.4_6773.20130222"
|
||||
#define FW_RTL8188EU "rtlwifi/rtl8188eufw.bin"
|
||||
|
||||
struct registry_priv {
|
||||
u8 chip_version;
|
||||
u8 rfintfs;
|
||||
u8 lbkmode;
|
||||
u8 hci;
|
||||
|
@ -222,7 +219,7 @@ struct adapter {
|
|||
|
||||
#define adapter_to_dvobj(adapter) (adapter->dvobj)
|
||||
|
||||
int rtw_handle_dualmac(struct adapter *adapter, bool init);
|
||||
void rtw_handle_dualmac(struct adapter *adapter, bool init);
|
||||
|
||||
static inline u8 *myid(struct eeprom_priv *peepriv)
|
||||
{
|
||||
|
|
|
@ -143,8 +143,4 @@ u8 MRateToHwRate(u8 rate);
|
|||
|
||||
void HalSetBrateCfg(struct adapter *Adapter, u8 *mBratesOS, u16 *pBrateCfg);
|
||||
|
||||
bool Hal_MappingOutPipe(struct adapter *pAdapter, u8 NumOutPipe);
|
||||
|
||||
s32 c2h_evt_read(struct adapter *adapter, u8 *buf);
|
||||
|
||||
#endif /* __HAL_COMMON_H__ */
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
|
||||
typedef s32 (*c2h_id_filter)(u8 id);
|
||||
|
||||
void rtl8188eu_interface_configure(struct adapter *adapt);
|
||||
void ReadAdapterInfo8188EU(struct adapter *Adapter);
|
||||
int rtl8188eu_interface_configure(struct adapter *adapt);
|
||||
int ReadAdapterInfo8188EU(struct adapter *Adapter);
|
||||
void rtl8188eu_init_default_value(struct adapter *adapt);
|
||||
void rtl8188e_SetHalODMVar(struct adapter *Adapter, void *pValue1, bool bSet);
|
||||
u32 rtl8188eu_InitPowerOn(struct adapter *adapt);
|
||||
|
@ -39,7 +39,6 @@ void rtw_hal_update_ra_mask(struct adapter *padapter, u32 mac_id, u8 level);
|
|||
void rtw_hal_clone_data(struct adapter *dst_adapt,
|
||||
struct adapter *src_adapt);
|
||||
|
||||
void indicate_wx_scan_complete_event(struct adapter *padapter);
|
||||
u8 rtw_do_join(struct adapter *padapter);
|
||||
|
||||
#endif /* __HAL_INTF_H__ */
|
||||
|
|
|
@ -1,89 +0,0 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
|
||||
/* Copyright(c) 2007 - 2011 Realtek Corporation. i*/
|
||||
|
||||
#ifndef __IOCTL_CFG80211_H__
|
||||
#define __IOCTL_CFG80211_H__
|
||||
|
||||
struct rtw_wdev_invit_info {
|
||||
u8 token;
|
||||
u8 flags;
|
||||
u8 status;
|
||||
u8 req_op_ch;
|
||||
u8 rsp_op_ch;
|
||||
};
|
||||
|
||||
#define rtw_wdev_invit_info_init(invit_info) \
|
||||
do { \
|
||||
(invit_info)->token = 0; \
|
||||
(invit_info)->flags = 0x00; \
|
||||
(invit_info)->status = 0xff; \
|
||||
(invit_info)->req_op_ch = 0; \
|
||||
(invit_info)->rsp_op_ch = 0; \
|
||||
} while (0)
|
||||
|
||||
struct rtw_wdev_priv {
|
||||
struct wireless_dev *rtw_wdev;
|
||||
|
||||
struct adapter *padapter;
|
||||
|
||||
struct cfg80211_scan_request *scan_request;
|
||||
spinlock_t scan_req_lock;
|
||||
|
||||
struct net_device *pmon_ndev;/* for monitor interface */
|
||||
char ifname_mon[IFNAMSIZ + 1]; /* name of monitor interface */
|
||||
|
||||
u8 p2p_enabled;
|
||||
|
||||
u8 provdisc_req_issued;
|
||||
|
||||
struct rtw_wdev_invit_info invit_info;
|
||||
|
||||
u8 bandroid_scan;
|
||||
bool block;
|
||||
bool power_mgmt;
|
||||
};
|
||||
|
||||
#define wdev_to_priv(w) ((struct rtw_wdev_priv *)(wdev_priv(w)))
|
||||
|
||||
#define wiphy_to_wdev(x) \
|
||||
((struct wireless_dev *)(((struct rtw_wdev_priv *)wiphy_priv(x))->rtw_wdev))
|
||||
|
||||
int rtw_wdev_alloc(struct adapter *padapter, struct device *dev);
|
||||
void rtw_wdev_free(struct wireless_dev *wdev);
|
||||
void rtw_wdev_unregister(struct wireless_dev *wdev);
|
||||
|
||||
void rtw_cfg80211_init_wiphy(struct adapter *padapter);
|
||||
|
||||
void rtw_cfg80211_surveydone_event_callback(struct adapter *padapter);
|
||||
|
||||
void rtw_cfg80211_indicate_connect(struct adapter *padapter);
|
||||
void rtw_cfg80211_indicate_disconnect(struct adapter *padapter);
|
||||
void rtw_cfg80211_indicate_scan_done(struct rtw_wdev_priv *pwdev_priv,
|
||||
bool aborted);
|
||||
|
||||
void rtw_cfg80211_indicate_sta_assoc(struct adapter *padapter,
|
||||
u8 *pmgmt_frame, uint frame_len);
|
||||
void rtw_cfg80211_indicate_sta_disassoc(struct adapter *padapter,
|
||||
unsigned char *da,
|
||||
unsigned short reason);
|
||||
|
||||
void rtw_cfg80211_issue_p2p_provision_request(struct adapter *padapter,
|
||||
const u8 *buf, size_t len);
|
||||
void rtw_cfg80211_rx_p2p_action_public(struct adapter *padapter,
|
||||
u8 *pmgmt_frame, uint frame_len);
|
||||
void rtw_cfg80211_rx_action_p2p(struct adapter *padapter, u8 *pmgmt_frame,
|
||||
uint frame_len);
|
||||
void rtw_cfg80211_rx_action(struct adapter *adapter, u8 *frame,
|
||||
uint frame_len, const char *msg);
|
||||
|
||||
int rtw_cfg80211_set_mgnt_wpsp2pie(struct net_device *net,
|
||||
char *buf, int len, int type);
|
||||
|
||||
bool rtw_cfg80211_pwr_mgmt(struct adapter *adapter);
|
||||
|
||||
#define rtw_cfg80211_rx_mgmt(dev, freq, sig_dbm, buf, len, gfp) \
|
||||
cfg80211_rx_mgmt(dev, freq, sig_dbm, buf, len, gfp)
|
||||
#define rtw_cfg80211_send_rx_assoc(dev, bss, buf, len) \
|
||||
cfg80211_send_rx_assoc(dev, bss, buf, len)
|
||||
|
||||
#endif /* __IOCTL_CFG80211_H__ */
|
|
@ -1,19 +0,0 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
|
||||
/* Copyright(c) 2007 - 2011 Realtek Corporation. */
|
||||
|
||||
#ifndef __MLME_OSDEP_H_
|
||||
#define __MLME_OSDEP_H_
|
||||
|
||||
#include "osdep_service.h"
|
||||
#include "drv_types.h"
|
||||
|
||||
void rtw_init_mlme_timer(struct adapter *padapter);
|
||||
void rtw_os_indicate_disconnect(struct adapter *adapter);
|
||||
void rtw_os_indicate_connect(struct adapter *adapter);
|
||||
void rtw_os_indicate_scan_done(struct adapter *padapter, bool aborted);
|
||||
void rtw_report_sec_ie(struct adapter *adapter, u8 authmode, u8 *sec_ie);
|
||||
|
||||
void rtw_reset_securitypriv(struct adapter *adapter);
|
||||
void indicate_wx_scan_complete_event(struct adapter *padapter);
|
||||
|
||||
#endif /* _MLME_OSDEP_H_ */
|
|
@ -66,5 +66,4 @@ void ODM_PhyStatusQuery(struct odm_dm_struct *pDM_Odm,
|
|||
struct odm_per_pkt_info *pPktinfo,
|
||||
struct adapter *adapt);
|
||||
|
||||
enum HAL_STATUS ODM_ConfigRFWithHeaderFile(struct odm_dm_struct *pDM_Odm);
|
||||
#endif
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
|
||||
/* Copyright(c) 2007 - 2011 Realtek Corporation. */
|
||||
|
||||
#ifndef __INC_ODM_REGCONFIG_H_8188E
|
||||
#define __INC_ODM_REGCONFIG_H_8188E
|
||||
|
||||
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);
|
||||
|
||||
void odm_ConfigBB_AGC_8188E(struct odm_dm_struct *pDM_Odm, u32 Addr,
|
||||
u32 Bitmask, u32 Data);
|
||||
|
||||
void odm_ConfigBB_PHY_REG_PG_8188E(struct odm_dm_struct *pDM_Odm, u32 Addr,
|
||||
u32 Bitmask, u32 Data);
|
||||
|
||||
void odm_ConfigBB_PHY_8188E(struct odm_dm_struct *pDM_Odm, u32 Addr,
|
||||
u32 Bitmask, u32 Data);
|
||||
|
||||
#endif
|
|
@ -6,11 +6,6 @@
|
|||
|
||||
#define ODM_CE 0x04 /* BIT(2) */
|
||||
|
||||
enum HAL_STATUS {
|
||||
HAL_STATUS_SUCCESS,
|
||||
HAL_STATUS_FAILURE,
|
||||
};
|
||||
|
||||
#define SET_TX_DESC_ANTSEL_A_88E(__ptxdesc, __value) \
|
||||
le32p_replace_bits((__le32 *)(__ptxdesc + 8), __value, BIT(24))
|
||||
#define SET_TX_DESC_ANTSEL_B_88E(__ptxdesc, __value) \
|
||||
|
|
|
@ -39,6 +39,9 @@ The protection mechanism is through the pending queue.
|
|||
u8 bio_timer_cancel;
|
||||
};
|
||||
|
||||
int netdev_open(struct net_device *pnetdev);
|
||||
int netdev_close(struct net_device *pnetdev);
|
||||
|
||||
u8 rtw_init_drv_sw(struct adapter *padapter);
|
||||
u8 rtw_free_drv_sw(struct adapter *padapter);
|
||||
u8 rtw_reset_drv_sw(struct adapter *padapter);
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
|
||||
/* Copyright(c) 2007 - 2011 Realtek Corporation. */
|
||||
|
||||
#ifndef __RECV_OSDEP_H_
|
||||
#define __RECV_OSDEP_H_
|
||||
|
||||
#include "osdep_service.h"
|
||||
#include "drv_types.h"
|
||||
|
||||
int _rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *padapter);
|
||||
void _rtw_free_recv_priv(struct recv_priv *precvpriv);
|
||||
|
||||
s32 rtw_recv_entry(struct recv_frame *precv_frame);
|
||||
int rtw_recv_indicatepkt(struct adapter *adapter, struct recv_frame *recv_frame);
|
||||
void rtw_recv_returnpacket(struct net_device *cnxt, struct sk_buff *retpkt);
|
||||
|
||||
void rtw_handle_tkip_mic_err(struct adapter *padapter, u8 bgroup);
|
||||
|
||||
int rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *padapter);
|
||||
void rtw_free_recv_priv(struct recv_priv *precvpriv);
|
||||
|
||||
int rtw_os_recvbuf_resource_alloc(struct adapter *adapt, struct recv_buf *buf);
|
||||
int rtw_os_recvbuf_resource_free(struct adapter *adapt, struct recv_buf *buf);
|
||||
|
||||
void rtw_init_recv_timer(struct recv_reorder_ctrl *preorder_ctrl);
|
||||
int _netdev_open(struct net_device *pnetdev);
|
||||
int netdev_open(struct net_device *pnetdev);
|
||||
int netdev_close(struct net_device *pnetdev);
|
||||
|
||||
#endif /* */
|
|
@ -23,7 +23,6 @@
|
|||
#include "HalHWImg8188E_MAC.h"
|
||||
#include "HalHWImg8188E_RF.h"
|
||||
#include "HalHWImg8188E_BB.h"
|
||||
#include "odm_RegConfig8188E.h"
|
||||
#include "odm_RTL8188E.h"
|
||||
|
||||
#define DRVINFO_SZ 4 /* unit is 8bytes */
|
||||
|
@ -36,7 +35,6 @@
|
|||
0x2400 /* 9k for 88E nornal chip , MaxRxBuff=10k-max(TxReportSize(64*8),
|
||||
* WOLPattern(16*24)) */
|
||||
|
||||
#define TX_SELE_HQ BIT(0) /* High Queue */
|
||||
#define TX_SELE_LQ BIT(1) /* Low Queue */
|
||||
#define TX_SELE_NQ BIT(2) /* Normal Queue */
|
||||
|
||||
|
@ -51,12 +49,6 @@
|
|||
|
||||
#define TX_PAGE_BOUNDARY_88E (TX_TOTAL_PAGE_NUMBER_88E + 1)
|
||||
|
||||
/* Note: For Normal Chip Setting ,modify later */
|
||||
#define WMM_NORMAL_TX_TOTAL_PAGE_NUMBER \
|
||||
TX_TOTAL_PAGE_NUMBER_88E /* 0xA9 , 0xb0=>176=>22k */
|
||||
#define WMM_NORMAL_TX_PAGE_BOUNDARY_88E \
|
||||
(WMM_NORMAL_TX_TOTAL_PAGE_NUMBER + 1) /* 0xA9 */
|
||||
|
||||
#include "HalVerDef.h"
|
||||
#include "hal_com.h"
|
||||
|
||||
|
@ -155,8 +147,7 @@ struct hal_data_8188e {
|
|||
u8 AntDivCfg;
|
||||
u8 TRxAntDivType;
|
||||
|
||||
u8 OutEpQueueSel;
|
||||
u8 OutEpNumber;
|
||||
u8 out_ep_extra_queues;
|
||||
|
||||
struct P2P_PS_Offload_t p2p_ps_offload;
|
||||
|
||||
|
|
|
@ -33,8 +33,6 @@ enum rx_packet_type {
|
|||
HIS_REPORT,/* USB HISR RPT */
|
||||
};
|
||||
|
||||
s32 rtl8188eu_init_recv_priv(struct adapter *padapter);
|
||||
void rtl8188eu_free_recv_priv(struct adapter * padapter);
|
||||
void rtl8188eu_recv_tasklet(unsigned long priv);
|
||||
void update_recvframe_phyinfo_88e(struct recv_frame *fra, struct phy_stat *phy);
|
||||
void update_recvframe_attrib_88e(struct recv_frame *fra, struct recv_stat *stat);
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#define RF6052_MAX_REG 0x3F
|
||||
#define RF6052_MAX_PATH 2
|
||||
|
||||
int PHY_RF6052_Config8188E(struct adapter *Adapter);
|
||||
int phy_RF6052_Config_ParaFile(struct adapter *Adapter);
|
||||
void rtl8188e_PHY_RF6052SetBandwidth(struct adapter *Adapter,
|
||||
enum ht_channel_width Bandwidth);
|
||||
void rtl8188e_PHY_RF6052SetCckTxPower(struct adapter *Adapter, u8 *level);
|
||||
|
|
|
@ -924,15 +924,9 @@ Current IOREG MAP
|
|||
#define _LLT_OP_VALUE(x) (((x) >> 30) & 0x3)
|
||||
|
||||
/* 0x0200h ~ 0x027Fh TXDMA Configuration */
|
||||
/* 2RQPN */
|
||||
#define _HPQ(x) ((x) & 0xFF)
|
||||
#define _LPQ(x) (((x) & 0xFF) << 8)
|
||||
#define _PUBQ(x) (((x) & 0xFF) << 16)
|
||||
/* NOTE: in RQPN_NPQ register */
|
||||
#define _NPQ(x) ((x) & 0xFF)
|
||||
|
||||
#define HPQ_PUBLIC_DIS BIT(24)
|
||||
#define LPQ_PUBLIC_DIS BIT(25)
|
||||
#define NUM_HQ 0x29
|
||||
|
||||
#define LD_RQPN BIT(31)
|
||||
|
||||
/* 2TDECTRL */
|
||||
|
|
|
@ -83,12 +83,6 @@
|
|||
/* OFFSET 20 */
|
||||
#define RTY_LMT_EN BIT(17)
|
||||
|
||||
enum TXDESC_SC {
|
||||
SC_DONT_CARE = 0x00,
|
||||
SC_UPPER = 0x01,
|
||||
SC_LOWER = 0x02,
|
||||
SC_DUPLICATE = 0x03
|
||||
};
|
||||
/* OFFSET 20 */
|
||||
#define SGI BIT(6)
|
||||
#define USB_TXAGG_NUM_SHT 24
|
||||
|
@ -147,6 +141,4 @@ bool rtl8188eu_xmitframe_complete(struct adapter *padapter,
|
|||
struct xmit_priv *pxmitpriv,
|
||||
struct xmit_buf *pxmitbuf);
|
||||
|
||||
void handle_txrpt_ccx_88e(struct adapter *adapter, u8 *buf);
|
||||
|
||||
#endif /* __RTL8188E_XMIT_H__ */
|
||||
|
|
|
@ -10,8 +10,6 @@
|
|||
/* external function */
|
||||
void rtw_indicate_sta_assoc_event(struct adapter *padapter,
|
||||
struct sta_info *psta);
|
||||
void rtw_indicate_sta_disassoc_event(struct adapter *padapter,
|
||||
struct sta_info *psta);
|
||||
void init_mlme_ap_info(struct adapter *padapter);
|
||||
void free_mlme_ap_info(struct adapter *padapter);
|
||||
void update_beacon(struct adapter *padapter, u8 ie_id,
|
||||
|
|
|
@ -730,9 +730,7 @@ Result:
|
|||
#define H2C_CMD_OVERFLOW 0x06
|
||||
#define H2C_RESERVED 0x07
|
||||
|
||||
u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid,
|
||||
int ssid_num, struct rtw_ieee80211_channel *ch,
|
||||
int ch_num);
|
||||
u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid, int ssid_num);
|
||||
u8 rtw_createbss_cmd(struct adapter *padapter);
|
||||
u8 rtw_setstakey_cmd(struct adapter *padapter, u8 *psta, u8 unicast_key);
|
||||
u8 rtw_clearstakey_cmd(struct adapter *padapter, u8 *psta, u8 entry, u8 enqueue);
|
||||
|
|
|
@ -21,20 +21,15 @@ enum LED_CTL_MODE {
|
|||
};
|
||||
|
||||
enum LED_STATE_871x {
|
||||
LED_UNKNOWN = 0,
|
||||
RTW_LED_ON = 1,
|
||||
RTW_LED_OFF = 2,
|
||||
LED_BLINK_NORMAL = 3,
|
||||
LED_BLINK_SLOWLY = 4,
|
||||
LED_BLINK_SCAN = 6, /* LED is blinking during scanning period,
|
||||
* the # of times to blink is depend on time
|
||||
* for scanning. */
|
||||
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,
|
||||
LED_BLINK_RUNTOP = 13, /* Customized for RunTop */
|
||||
};
|
||||
|
||||
struct led_priv {
|
||||
|
@ -43,8 +38,6 @@ struct led_priv {
|
|||
bool bRegUseLed;
|
||||
|
||||
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. */
|
||||
|
||||
bool bLedOn; /* true if LED is ON, false if LED is OFF. */
|
||||
|
||||
|
@ -54,7 +47,6 @@ struct led_priv {
|
|||
|
||||
u32 BlinkTimes; /* Number of times to toggle led state for blinking. */
|
||||
|
||||
bool bLedNoLinkBlinkInProgress;
|
||||
bool bLedLinkBlinkInProgress;
|
||||
bool bLedScanBlinkInProgress;
|
||||
struct delayed_work blink_work;
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
#define __RTW_MLME_H_
|
||||
|
||||
#include "osdep_service.h"
|
||||
#include "mlme_osdep.h"
|
||||
#include "drv_types.h"
|
||||
#include "wlan_bssdef.h"
|
||||
|
||||
|
@ -64,17 +63,6 @@ enum rt_scan_type {
|
|||
SCAN_MIX,
|
||||
};
|
||||
|
||||
enum SCAN_RESULT_TYPE {
|
||||
SCAN_RESULT_P2P_ONLY = 0, /* Will return all the P2P devices. */
|
||||
SCAN_RESULT_ALL = 1, /* Will return all the scanned device,
|
||||
* include AP. */
|
||||
SCAN_RESULT_WFD_TYPE = 2 /* Will just return the correct WFD
|
||||
* device. */
|
||||
/* If this device is Miracast sink
|
||||
* device, it will just return all the
|
||||
* Miracast source devices. */
|
||||
};
|
||||
|
||||
/*
|
||||
there are several "locks" in mlme_priv,
|
||||
since mlme_priv is a shared resource between many threads,
|
||||
|
@ -433,8 +421,6 @@ void indicate_wx_scan_complete_event(struct adapter *padapter);
|
|||
void rtw_indicate_wx_assoc_event(struct adapter *padapter);
|
||||
void rtw_indicate_wx_disassoc_event(struct adapter *padapter);
|
||||
int event_thread(void *context);
|
||||
void rtw_join_timeout_handler (struct timer_list *t);
|
||||
void _rtw_scan_timeout_handler (struct timer_list *t);
|
||||
void rtw_free_network_queue(struct adapter *adapter, u8 isfreeall);
|
||||
int rtw_init_mlme_priv(struct adapter *adapter);
|
||||
void rtw_free_mlme_priv (struct mlme_priv *pmlmepriv);
|
||||
|
@ -537,7 +523,7 @@ struct wlan_network *rtw_get_oldest_wlan_network(struct __queue *scanned_queue);
|
|||
void rtw_free_assoc_resources(struct adapter *adapter, int lock_scanned_queue);
|
||||
void rtw_indicate_disconnect(struct adapter *adapter);
|
||||
void rtw_indicate_connect(struct adapter *adapter);
|
||||
void rtw_indicate_scan_done( struct adapter *padapter, bool aborted);
|
||||
void rtw_indicate_scan_done(struct adapter *padapter);
|
||||
|
||||
int rtw_restruct_sec_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie,
|
||||
uint in_len);
|
||||
|
@ -551,10 +537,6 @@ void _rtw_join_timeout_handler(struct adapter *adapter);
|
|||
void rtw_scan_timeout_handler(struct adapter *adapter);
|
||||
|
||||
void rtw_dynamic_check_timer_handlder(struct adapter *adapter);
|
||||
#define rtw_is_scan_deny(adapter) false
|
||||
#define rtw_clear_scan_deny(adapter) do {} while (0)
|
||||
#define rtw_set_scan_deny_timer_hdl(adapter) do {} while (0)
|
||||
#define rtw_set_scan_deny(adapter, ms) do {} while (0)
|
||||
|
||||
void rtw_free_mlme_priv_ie_data(struct mlme_priv *pmlmepriv);
|
||||
|
||||
|
|
|
@ -388,15 +388,11 @@ struct mlme_ext_priv {
|
|||
void init_mlme_ext_priv(struct adapter *adapter);
|
||||
int init_hw_mlme_ext(struct adapter *padapter);
|
||||
void free_mlme_ext_priv (struct mlme_ext_priv *pmlmeext);
|
||||
extern void init_mlme_ext_timer(struct adapter *padapter);
|
||||
extern void init_addba_retry_timer(struct adapter *adapt, struct sta_info *sta);
|
||||
extern struct xmit_frame *alloc_mgtxmitframe(struct xmit_priv *pxmitpriv);
|
||||
|
||||
unsigned char networktype_to_raid(unsigned char network_type);
|
||||
u8 judge_network_type(struct adapter *padapter, unsigned char *rate, int len);
|
||||
void get_rate_set(struct adapter *padapter, unsigned char *pbssrate, int *len);
|
||||
void UpdateBrateTbl(struct adapter *padapter, u8 *mBratesOS);
|
||||
void UpdateBrateTblForSoftAP(u8 *bssrateset, u32 bssratelen);
|
||||
|
||||
void Save_DM_Func_Flag(struct adapter *padapter);
|
||||
void Restore_DM_Func_Flag(struct adapter *padapter);
|
||||
|
|
|
@ -243,6 +243,9 @@ struct recv_frame {
|
|||
struct recv_reorder_ctrl *preorder_ctrl;
|
||||
};
|
||||
|
||||
int _rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *padapter);
|
||||
void _rtw_free_recv_priv(struct recv_priv *precvpriv);
|
||||
s32 rtw_recv_entry(struct recv_frame *precv_frame);
|
||||
struct recv_frame *_rtw_alloc_recvframe(struct __queue *pfree_recv_queue);
|
||||
struct recv_frame *rtw_alloc_recvframe(struct __queue *pfree_recv_queue);
|
||||
int rtw_free_recvframe(struct recv_frame *precvframe,
|
||||
|
|
|
@ -7,6 +7,9 @@
|
|||
#include "osdep_service.h"
|
||||
#include "drv_types.h"
|
||||
|
||||
#define NR_XMITFRAME 256
|
||||
#define WMM_XMIT_THRESHOLD (NR_XMITFRAME * 2 / 5)
|
||||
|
||||
#define MAX_XMITBUF_SZ (20480) /* 20k */
|
||||
#define NR_XMITBUFF (4)
|
||||
|
||||
|
@ -304,6 +307,15 @@ struct xmit_priv {
|
|||
struct submit_ctx ack_tx_ops;
|
||||
};
|
||||
|
||||
struct pkt_file {
|
||||
struct sk_buff *pkt;
|
||||
size_t pkt_len; /* the remainder length of the open_file */
|
||||
unsigned char *cur_buffer;
|
||||
u8 *buf_start;
|
||||
u8 *cur_addr;
|
||||
size_t buf_len;
|
||||
};
|
||||
|
||||
struct xmit_buf *rtw_alloc_xmitbuf_ext(struct xmit_priv *pxmitpriv);
|
||||
s32 rtw_free_xmitbuf_ext(struct xmit_priv *pxmitpriv,
|
||||
struct xmit_buf *pxmitbuf);
|
||||
|
@ -355,7 +367,7 @@ u32 rtw_get_ff_hwaddr(struct xmit_frame *pxmitframe);
|
|||
int rtw_ack_tx_wait(struct xmit_priv *pxmitpriv, u32 timeout_ms);
|
||||
void rtw_ack_tx_done(struct xmit_priv *pxmitpriv, int status);
|
||||
|
||||
/* include after declaring struct xmit_buf, in order to avoid warning */
|
||||
#include "xmit_osdep.h"
|
||||
void rtw_xmit_complete(struct adapter *padapter, struct xmit_frame *pxframe);
|
||||
netdev_tx_t rtw_xmit_entry(struct sk_buff *pkt, struct net_device *pnetdev);
|
||||
|
||||
#endif /* _RTL871X_XMIT_H_ */
|
||||
|
|
|
@ -133,10 +133,6 @@ struct ndis_802_11_assoc_info {
|
|||
u32 OffsetResponseIEs;
|
||||
};
|
||||
|
||||
enum ndis_802_11_reload_def {
|
||||
Ndis802_11ReloadWEPKeys
|
||||
};
|
||||
|
||||
/* Key mapping keys require a BSSID */
|
||||
struct ndis_802_11_key {
|
||||
u32 Length; /* Length of this structure */
|
||||
|
|
|
@ -1,49 +0,0 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
|
||||
/* Copyright(c) 2007 - 2011 Realtek Corporation. */
|
||||
|
||||
#ifndef __XMIT_OSDEP_H_
|
||||
#define __XMIT_OSDEP_H_
|
||||
|
||||
#include "osdep_service.h"
|
||||
#include "drv_types.h"
|
||||
|
||||
struct pkt_file {
|
||||
struct sk_buff *pkt;
|
||||
size_t pkt_len; /* the remainder length of the open_file */
|
||||
unsigned char *cur_buffer;
|
||||
u8 *buf_start;
|
||||
u8 *cur_addr;
|
||||
size_t buf_len;
|
||||
};
|
||||
|
||||
extern int rtw_ht_enable;
|
||||
extern int rtw_cbw40_enable;
|
||||
extern int rtw_ampdu_enable;/* for enable tx_ampdu */
|
||||
|
||||
#define NR_XMITFRAME 256
|
||||
|
||||
struct xmit_priv;
|
||||
struct pkt_attrib;
|
||||
struct sta_xmit_priv;
|
||||
struct xmit_frame;
|
||||
struct xmit_buf;
|
||||
|
||||
int rtw_xmit_entry(struct sk_buff *pkt, struct net_device *pnetdev);
|
||||
|
||||
void rtw_os_xmit_schedule(struct adapter *padapter);
|
||||
|
||||
int rtw_os_xmit_resource_alloc(struct adapter *padapter,
|
||||
struct xmit_buf *pxmitbuf, u32 alloc_sz);
|
||||
void rtw_os_xmit_resource_free(struct adapter *padapter,
|
||||
struct xmit_buf *pxmitbuf, u32 free_sz);
|
||||
|
||||
uint rtw_remainder_len(struct pkt_file *pfile);
|
||||
void _rtw_open_pktfile(struct sk_buff *pkt, struct pkt_file *pfile);
|
||||
uint _rtw_pktfile_read(struct pkt_file *pfile, u8 *rmem, uint rlen);
|
||||
bool rtw_endofpktfile(struct pkt_file *pfile);
|
||||
|
||||
void rtw_os_pkt_complete(struct adapter *padapter, struct sk_buff *pkt);
|
||||
void rtw_os_xmit_complete(struct adapter *padapter,
|
||||
struct xmit_frame *pxframe);
|
||||
|
||||
#endif /* __XMIT_OSDEP_H_ */
|
|
@ -1099,7 +1099,7 @@ static int rtw_wx_set_scan(struct net_device *dev, struct iw_request_info *a,
|
|||
|
||||
spin_lock_bh(&pmlmepriv->lock);
|
||||
|
||||
_status = rtw_sitesurvey_cmd(padapter, ssid, 1, NULL, 0);
|
||||
_status = rtw_sitesurvey_cmd(padapter, ssid, 1);
|
||||
|
||||
spin_unlock_bh(&pmlmepriv->lock);
|
||||
}
|
||||
|
@ -1836,7 +1836,7 @@ static int rtw_wx_set_enc_ext(struct net_device *dev,
|
|||
goto out;
|
||||
}
|
||||
|
||||
strlcpy((char *)param->u.crypt.alg, alg_name, IEEE_CRYPT_ALG_NAME_LEN);
|
||||
strscpy((char *)param->u.crypt.alg, alg_name, IEEE_CRYPT_ALG_NAME_LEN);
|
||||
|
||||
if (pext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY)
|
||||
param->u.crypt.set_tx = 1;
|
||||
|
@ -2079,7 +2079,7 @@ static int rtw_wext_p2p_enable(struct net_device *dev,
|
|||
struct iw_request_info *info,
|
||||
union iwreq_data *wrqu, char *extra)
|
||||
{
|
||||
int ret = 0;
|
||||
int ret;
|
||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
||||
struct wifidirect_info *pwdinfo = &padapter->wdinfo;
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
|
@ -2094,10 +2094,9 @@ static int rtw_wext_p2p_enable(struct net_device *dev,
|
|||
else if (*extra == '3')
|
||||
init_role = P2P_ROLE_GO;
|
||||
|
||||
if (_FAIL == rtw_p2p_enable(padapter, init_role)) {
|
||||
ret = -EFAULT;
|
||||
goto exit;
|
||||
}
|
||||
ret = rtw_p2p_enable(padapter, init_role);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/* set channel/bandwidth */
|
||||
if (init_role != P2P_ROLE_DISABLE) {
|
||||
|
@ -2121,8 +2120,7 @@ static int rtw_wext_p2p_enable(struct net_device *dev,
|
|||
set_channel_bwmode(padapter, channel, ch_offset, bwmode);
|
||||
}
|
||||
|
||||
exit:
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void rtw_p2p_set_go_nego_ssid(struct net_device *dev,
|
||||
|
|
|
@ -1,205 +0,0 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/* Copyright(c) 2007 - 2011 Realtek Corporation. i*/
|
||||
|
||||
#define _MLME_OSDEP_C_
|
||||
|
||||
#include "../include/osdep_service.h"
|
||||
#include "../include/drv_types.h"
|
||||
#include "../include/mlme_osdep.h"
|
||||
|
||||
void rtw_join_timeout_handler (struct timer_list *t)
|
||||
{
|
||||
struct adapter *adapter = from_timer(adapter, t, mlmepriv.assoc_timer);
|
||||
|
||||
_rtw_join_timeout_handler(adapter);
|
||||
}
|
||||
|
||||
void _rtw_scan_timeout_handler (struct timer_list *t)
|
||||
{
|
||||
struct adapter *adapter = from_timer(adapter, t, mlmepriv.scan_to_timer);
|
||||
|
||||
rtw_scan_timeout_handler(adapter);
|
||||
}
|
||||
|
||||
static void _dynamic_check_timer_handlder(struct timer_list *t)
|
||||
{
|
||||
struct adapter *adapter = from_timer(adapter, t, mlmepriv.dynamic_chk_timer);
|
||||
|
||||
rtw_dynamic_check_timer_handlder(adapter);
|
||||
_set_timer(&adapter->mlmepriv.dynamic_chk_timer, 2000);
|
||||
}
|
||||
|
||||
void rtw_init_mlme_timer(struct adapter *padapter)
|
||||
{
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
|
||||
timer_setup(&pmlmepriv->assoc_timer, rtw_join_timeout_handler, 0);
|
||||
timer_setup(&pmlmepriv->scan_to_timer, _rtw_scan_timeout_handler, 0);
|
||||
timer_setup(&pmlmepriv->dynamic_chk_timer, _dynamic_check_timer_handlder, 0);
|
||||
}
|
||||
|
||||
void rtw_os_indicate_connect(struct adapter *adapter)
|
||||
{
|
||||
|
||||
rtw_indicate_wx_assoc_event(adapter);
|
||||
netif_carrier_on(adapter->pnetdev);
|
||||
if (adapter->pid[2] != 0)
|
||||
rtw_signal_process(adapter->pid[2], SIGALRM);
|
||||
|
||||
}
|
||||
|
||||
void rtw_os_indicate_scan_done(struct adapter *padapter, bool aborted)
|
||||
{
|
||||
indicate_wx_scan_complete_event(padapter);
|
||||
}
|
||||
|
||||
static struct rt_pmkid_list backup_pmkid[NUM_PMKID_CACHE];
|
||||
|
||||
void rtw_reset_securitypriv(struct adapter *adapter)
|
||||
{
|
||||
u8 backup_index = 0;
|
||||
u8 backup_counter = 0x00;
|
||||
u32 backup_time = 0;
|
||||
|
||||
if (adapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X) {
|
||||
/* 802.1x */
|
||||
/* We have to backup the PMK information for WiFi PMK Caching test item. */
|
||||
/* Backup the btkip_countermeasure information. */
|
||||
/* When the countermeasure is trigger, the driver have to disconnect with AP for 60 seconds. */
|
||||
memcpy(&backup_pmkid[0], &adapter->securitypriv.PMKIDList[0], sizeof(struct rt_pmkid_list) * NUM_PMKID_CACHE);
|
||||
backup_index = adapter->securitypriv.PMKIDIndex;
|
||||
backup_counter = adapter->securitypriv.btkip_countermeasure;
|
||||
backup_time = adapter->securitypriv.btkip_countermeasure_time;
|
||||
memset((unsigned char *)&adapter->securitypriv, 0, sizeof(struct security_priv));
|
||||
|
||||
/* Restore the PMK information to securitypriv structure for the following connection. */
|
||||
memcpy(&adapter->securitypriv.PMKIDList[0],
|
||||
&backup_pmkid[0],
|
||||
sizeof(struct rt_pmkid_list) * NUM_PMKID_CACHE);
|
||||
adapter->securitypriv.PMKIDIndex = backup_index;
|
||||
adapter->securitypriv.btkip_countermeasure = backup_counter;
|
||||
adapter->securitypriv.btkip_countermeasure_time = backup_time;
|
||||
adapter->securitypriv.ndisauthtype = Ndis802_11AuthModeOpen;
|
||||
adapter->securitypriv.ndisencryptstatus = Ndis802_11WEPDisabled;
|
||||
} else {
|
||||
/* reset values in securitypriv */
|
||||
struct security_priv *psec_priv = &adapter->securitypriv;
|
||||
|
||||
psec_priv->dot11AuthAlgrthm = dot11AuthAlgrthm_Open; /* open system */
|
||||
psec_priv->dot11PrivacyAlgrthm = _NO_PRIVACY_;
|
||||
psec_priv->dot11PrivacyKeyIndex = 0;
|
||||
psec_priv->dot118021XGrpPrivacy = _NO_PRIVACY_;
|
||||
psec_priv->dot118021XGrpKeyid = 1;
|
||||
psec_priv->ndisauthtype = Ndis802_11AuthModeOpen;
|
||||
psec_priv->ndisencryptstatus = Ndis802_11WEPDisabled;
|
||||
}
|
||||
}
|
||||
|
||||
void rtw_os_indicate_disconnect(struct adapter *adapter)
|
||||
{
|
||||
|
||||
netif_carrier_off(adapter->pnetdev); /* Do it first for tx broadcast pkt after disconnection issue! */
|
||||
rtw_indicate_wx_disassoc_event(adapter);
|
||||
rtw_reset_securitypriv(adapter);
|
||||
}
|
||||
|
||||
void rtw_report_sec_ie(struct adapter *adapter, u8 authmode, u8 *sec_ie)
|
||||
{
|
||||
uint len;
|
||||
u8 *buff, *p, i;
|
||||
union iwreq_data wrqu;
|
||||
|
||||
buff = NULL;
|
||||
if (authmode == _WPA_IE_ID_) {
|
||||
buff = kzalloc(IW_CUSTOM_MAX, GFP_ATOMIC);
|
||||
if (!buff)
|
||||
return;
|
||||
p = buff;
|
||||
p += sprintf(p, "ASSOCINFO(ReqIEs =");
|
||||
len = sec_ie[1] + 2;
|
||||
len = (len < IW_CUSTOM_MAX) ? len : IW_CUSTOM_MAX;
|
||||
for (i = 0; i < len; i++)
|
||||
p += sprintf(p, "%02x", sec_ie[i]);
|
||||
p += sprintf(p, ")");
|
||||
memset(&wrqu, 0, sizeof(wrqu));
|
||||
wrqu.data.length = p - buff;
|
||||
wrqu.data.length = (wrqu.data.length < IW_CUSTOM_MAX) ?
|
||||
wrqu.data.length : IW_CUSTOM_MAX;
|
||||
wireless_send_event(adapter->pnetdev, IWEVCUSTOM, &wrqu, buff);
|
||||
kfree(buff);
|
||||
}
|
||||
}
|
||||
|
||||
static void _survey_timer_hdl(struct timer_list *t)
|
||||
{
|
||||
struct adapter *padapter = from_timer(padapter, t, mlmeextpriv.survey_timer);
|
||||
|
||||
survey_timer_hdl(padapter);
|
||||
}
|
||||
|
||||
static void _link_timer_hdl(struct timer_list *t)
|
||||
{
|
||||
struct adapter *padapter = from_timer(padapter, t, mlmeextpriv.link_timer);
|
||||
link_timer_hdl(padapter);
|
||||
}
|
||||
|
||||
static void _addba_timer_hdl(struct timer_list *t)
|
||||
{
|
||||
struct sta_info *psta = from_timer(psta, t, addba_retry_timer);
|
||||
addba_timer_hdl(psta);
|
||||
}
|
||||
|
||||
void init_addba_retry_timer(struct adapter *padapter, struct sta_info *psta)
|
||||
{
|
||||
timer_setup(&psta->addba_retry_timer, _addba_timer_hdl, 0);
|
||||
}
|
||||
|
||||
void init_mlme_ext_timer(struct adapter *padapter)
|
||||
{
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
|
||||
timer_setup(&pmlmeext->survey_timer, _survey_timer_hdl, 0);
|
||||
timer_setup(&pmlmeext->link_timer, _link_timer_hdl, 0);
|
||||
}
|
||||
|
||||
void rtw_indicate_sta_assoc_event(struct adapter *padapter, struct sta_info *psta)
|
||||
{
|
||||
union iwreq_data wrqu;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
|
||||
if (!psta)
|
||||
return;
|
||||
|
||||
if (psta->aid > NUM_STA)
|
||||
return;
|
||||
|
||||
if (pstapriv->sta_aid[psta->aid - 1] != psta)
|
||||
return;
|
||||
|
||||
wrqu.addr.sa_family = ARPHRD_ETHER;
|
||||
|
||||
memcpy(wrqu.addr.sa_data, psta->hwaddr, ETH_ALEN);
|
||||
|
||||
wireless_send_event(padapter->pnetdev, IWEVREGISTERED, &wrqu, NULL);
|
||||
}
|
||||
|
||||
void rtw_indicate_sta_disassoc_event(struct adapter *padapter, struct sta_info *psta)
|
||||
{
|
||||
union iwreq_data wrqu;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
|
||||
if (!psta)
|
||||
return;
|
||||
|
||||
if (psta->aid > NUM_STA)
|
||||
return;
|
||||
|
||||
if (pstapriv->sta_aid[psta->aid - 1] != psta)
|
||||
return;
|
||||
|
||||
wrqu.addr.sa_family = ARPHRD_ETHER;
|
||||
|
||||
memcpy(wrqu.addr.sa_data, psta->hwaddr, ETH_ALEN);
|
||||
|
||||
wireless_send_event(padapter->pnetdev, IWEVEXPIRED, &wrqu, NULL);
|
||||
}
|
|
@ -5,8 +5,6 @@
|
|||
|
||||
#include "../include/osdep_service.h"
|
||||
#include "../include/drv_types.h"
|
||||
#include "../include/xmit_osdep.h"
|
||||
#include "../include/recv_osdep.h"
|
||||
#include "../include/hal_intf.h"
|
||||
#include "../include/rtw_ioctl.h"
|
||||
#include "../include/usb_osintf.h"
|
||||
|
@ -17,14 +15,12 @@
|
|||
MODULE_LICENSE("GPL");
|
||||
MODULE_DESCRIPTION("Realtek Wireless Lan Driver");
|
||||
MODULE_AUTHOR("Realtek Semiconductor Corp.");
|
||||
MODULE_VERSION(DRIVERVERSION);
|
||||
MODULE_FIRMWARE("rtlwifi/rtl8188eufw.bin");
|
||||
MODULE_FIRMWARE(FW_RTL8188EU);
|
||||
|
||||
#define CONFIG_BR_EXT_BRNAME "br0"
|
||||
#define RTW_NOTCH_FILTER 0 /* 0:Disable, 1:Enable, */
|
||||
|
||||
/* module param defaults */
|
||||
static int rtw_chip_version = 0x00;
|
||||
static int rtw_rfintfs = HWPI;
|
||||
static int rtw_lbkmode;/* RTL8712_AIR_TRX; */
|
||||
static int rtw_network_mode = Ndis802_11IBSS;/* Ndis802_11Infrastructure; infra, ad-hoc, auto */
|
||||
|
@ -67,9 +63,9 @@ static int rtw_uapsd_acvo_en;
|
|||
|
||||
static int rtw_led_enable = 1;
|
||||
|
||||
int rtw_ht_enable = 1;
|
||||
int rtw_cbw40_enable = 3; /* 0 :disable, bit(0): enable 2.4g, bit(1): enable 5g */
|
||||
int rtw_ampdu_enable = 1;/* for enable tx_ampdu */
|
||||
static int rtw_ht_enable = 1;
|
||||
static int rtw_cbw40_enable = 3; /* 0 :disable, bit(0): enable 2.4g, bit(1): enable 5g */
|
||||
static int rtw_ampdu_enable = 1;/* for enable tx_ampdu */
|
||||
static int rtw_rx_stbc = 1;/* 0: disable, bit(0):enable 2.4g, bit(1):enable 5g, default is set to enable 2.4GHZ for IOT issue with bufflao's AP at 5GHZ */
|
||||
static int rtw_ampdu_amsdu;/* 0: disabled, 1:enabled, 2:auto */
|
||||
|
||||
|
@ -106,7 +102,6 @@ char *rtw_initmac; /* temp mac address if users want to use instead of the mac
|
|||
|
||||
module_param(rtw_initmac, charp, 0644);
|
||||
module_param(rtw_channel_plan, int, 0644);
|
||||
module_param(rtw_chip_version, int, 0644);
|
||||
module_param(rtw_rfintfs, int, 0644);
|
||||
module_param(rtw_lbkmode, int, 0644);
|
||||
module_param(rtw_network_mode, int, 0644);
|
||||
|
@ -153,7 +148,6 @@ static uint loadparam(struct adapter *padapter)
|
|||
{
|
||||
struct registry_priv *registry_par = &padapter->registrypriv;
|
||||
|
||||
registry_par->chip_version = (u8)rtw_chip_version;
|
||||
registry_par->rfintfs = (u8)rtw_rfintfs;
|
||||
registry_par->lbkmode = (u8)rtw_lbkmode;
|
||||
registry_par->network_mode = (u8)rtw_network_mode;
|
||||
|
@ -622,7 +616,7 @@ void netdev_br_init(struct net_device *netdev)
|
|||
rcu_read_unlock();
|
||||
}
|
||||
|
||||
int _netdev_open(struct net_device *pnetdev)
|
||||
static int _netdev_open(struct net_device *pnetdev)
|
||||
{
|
||||
uint status;
|
||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(pnetdev);
|
||||
|
@ -636,7 +630,7 @@ int _netdev_open(struct net_device *pnetdev)
|
|||
if (status == _FAIL)
|
||||
goto netdev_open_error;
|
||||
|
||||
pr_info("MAC Address = %pM\n", pnetdev->dev_addr);
|
||||
netdev_dbg(pnetdev, "MAC Address = %pM\n", pnetdev->dev_addr);
|
||||
|
||||
status = rtw_start_drv_threads(padapter);
|
||||
if (status == _FAIL) {
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
|
||||
#include "../include/osdep_service.h"
|
||||
#include "../include/drv_types.h"
|
||||
#include "../include/recv_osdep.h"
|
||||
#include "../include/rtw_ioctl_set.h"
|
||||
|
||||
/*
|
||||
|
@ -54,14 +53,13 @@ struct net_device *rtw_alloc_etherdev_with_old_priv(int sizeof_priv,
|
|||
|
||||
pnetdev = alloc_etherdev_mq(sizeof(struct rtw_netdev_priv_indicator), 4);
|
||||
if (!pnetdev)
|
||||
goto RETURN;
|
||||
return NULL;
|
||||
|
||||
pnetdev->dev.type = &wlan_type;
|
||||
pnpi = netdev_priv(pnetdev);
|
||||
pnpi->priv = old_priv;
|
||||
pnpi->sizeof_priv = sizeof_priv;
|
||||
|
||||
RETURN:
|
||||
return pnetdev;
|
||||
}
|
||||
|
||||
|
@ -72,19 +70,18 @@ struct net_device *rtw_alloc_etherdev(int sizeof_priv)
|
|||
|
||||
pnetdev = alloc_etherdev_mq(sizeof(struct rtw_netdev_priv_indicator), 4);
|
||||
if (!pnetdev)
|
||||
goto RETURN;
|
||||
return NULL;
|
||||
|
||||
pnpi = netdev_priv(pnetdev);
|
||||
|
||||
pnpi->priv = vzalloc(sizeof_priv);
|
||||
if (!pnpi->priv) {
|
||||
free_netdev(pnetdev);
|
||||
pnetdev = NULL;
|
||||
goto RETURN;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pnpi->sizeof_priv = sizeof_priv;
|
||||
RETURN:
|
||||
|
||||
return pnetdev;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,165 +0,0 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/* Copyright(c) 2007 - 2011 Realtek Corporation. */
|
||||
|
||||
#define _RECV_OSDEP_C_
|
||||
|
||||
#include "../include/osdep_service.h"
|
||||
#include "../include/drv_types.h"
|
||||
|
||||
#include "../include/wifi.h"
|
||||
#include "../include/recv_osdep.h"
|
||||
|
||||
#include "../include/osdep_intf.h"
|
||||
#include "../include/usb_ops.h"
|
||||
|
||||
/* alloc os related resource in struct recv_buf */
|
||||
int rtw_os_recvbuf_resource_alloc(struct adapter *padapter,
|
||||
struct recv_buf *precvbuf)
|
||||
{
|
||||
int res = _SUCCESS;
|
||||
|
||||
precvbuf->purb = usb_alloc_urb(0, GFP_KERNEL);
|
||||
if (!precvbuf->purb)
|
||||
res = _FAIL;
|
||||
precvbuf->pskb = NULL;
|
||||
precvbuf->reuse = false;
|
||||
return res;
|
||||
}
|
||||
|
||||
/* free os related resource in struct recv_buf */
|
||||
int rtw_os_recvbuf_resource_free(struct adapter *padapter,
|
||||
struct recv_buf *precvbuf)
|
||||
{
|
||||
usb_free_urb(precvbuf->purb);
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
void rtw_handle_tkip_mic_err(struct adapter *padapter, u8 bgroup)
|
||||
{
|
||||
union iwreq_data wrqu;
|
||||
struct iw_michaelmicfailure ev;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
struct security_priv *psecuritypriv = &padapter->securitypriv;
|
||||
u32 cur_time = 0;
|
||||
|
||||
if (psecuritypriv->last_mic_err_time == 0) {
|
||||
psecuritypriv->last_mic_err_time = jiffies;
|
||||
} else {
|
||||
cur_time = jiffies;
|
||||
|
||||
if (cur_time - psecuritypriv->last_mic_err_time < 60 * HZ) {
|
||||
psecuritypriv->btkip_countermeasure = true;
|
||||
psecuritypriv->last_mic_err_time = 0;
|
||||
psecuritypriv->btkip_countermeasure_time = cur_time;
|
||||
} else {
|
||||
psecuritypriv->last_mic_err_time = jiffies;
|
||||
}
|
||||
}
|
||||
|
||||
memset(&ev, 0x00, sizeof(ev));
|
||||
if (bgroup)
|
||||
ev.flags |= IW_MICFAILURE_GROUP;
|
||||
else
|
||||
ev.flags |= IW_MICFAILURE_PAIRWISE;
|
||||
|
||||
ev.src_addr.sa_family = ARPHRD_ETHER;
|
||||
memcpy(ev.src_addr.sa_data, &pmlmepriv->assoc_bssid[0], ETH_ALEN);
|
||||
memset(&wrqu, 0x00, sizeof(wrqu));
|
||||
wrqu.data.length = sizeof(ev);
|
||||
wireless_send_event(padapter->pnetdev, IWEVMICHAELMICFAILURE,
|
||||
&wrqu, (char *)&ev);
|
||||
}
|
||||
|
||||
int rtw_recv_indicatepkt(struct adapter *padapter,
|
||||
struct recv_frame *precv_frame)
|
||||
{
|
||||
struct recv_priv *precvpriv;
|
||||
struct __queue *pfree_recv_queue;
|
||||
struct sk_buff *skb;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
|
||||
precvpriv = &padapter->recvpriv;
|
||||
pfree_recv_queue = &precvpriv->free_recv_queue;
|
||||
|
||||
skb = precv_frame->pkt;
|
||||
if (!skb)
|
||||
goto _recv_indicatepkt_drop;
|
||||
|
||||
skb->data = precv_frame->rx_data;
|
||||
|
||||
skb_set_tail_pointer(skb, precv_frame->len);
|
||||
|
||||
skb->len = precv_frame->len;
|
||||
|
||||
if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
|
||||
struct sk_buff *pskb2 = NULL;
|
||||
struct sta_info *psta = NULL;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
struct rx_pkt_attrib *pattrib = &precv_frame->attrib;
|
||||
bool bmcast = is_multicast_ether_addr(pattrib->dst);
|
||||
|
||||
if (memcmp(pattrib->dst, myid(&padapter->eeprompriv),
|
||||
ETH_ALEN)) {
|
||||
if (bmcast) {
|
||||
psta = rtw_get_bcmc_stainfo(padapter);
|
||||
pskb2 = skb_clone(skb, GFP_ATOMIC);
|
||||
} else {
|
||||
psta = rtw_get_stainfo(pstapriv, pattrib->dst);
|
||||
}
|
||||
|
||||
if (psta) {
|
||||
struct net_device *pnetdev;
|
||||
|
||||
pnetdev = (struct net_device *)padapter->pnetdev;
|
||||
skb->dev = pnetdev;
|
||||
skb_set_queue_mapping(skb, rtw_recv_select_queue(skb));
|
||||
|
||||
rtw_xmit_entry(skb, pnetdev);
|
||||
|
||||
if (bmcast)
|
||||
skb = pskb2;
|
||||
else
|
||||
goto _recv_indicatepkt_end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rcu_read_lock();
|
||||
rcu_dereference(padapter->pnetdev->rx_handler_data);
|
||||
rcu_read_unlock();
|
||||
|
||||
skb->ip_summed = CHECKSUM_NONE;
|
||||
skb->dev = padapter->pnetdev;
|
||||
skb->protocol = eth_type_trans(skb, padapter->pnetdev);
|
||||
|
||||
netif_rx(skb);
|
||||
|
||||
_recv_indicatepkt_end:
|
||||
|
||||
/* pointers to NULL before rtw_free_recvframe() */
|
||||
precv_frame->pkt = NULL;
|
||||
|
||||
rtw_free_recvframe(precv_frame, pfree_recv_queue);
|
||||
|
||||
return _SUCCESS;
|
||||
|
||||
_recv_indicatepkt_drop:
|
||||
|
||||
/* enqueue back to free_recv_queue */
|
||||
rtw_free_recvframe(precv_frame, pfree_recv_queue);
|
||||
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
static void _rtw_reordering_ctrl_timeout_handler(struct timer_list *t)
|
||||
{
|
||||
struct recv_reorder_ctrl *preorder_ctrl;
|
||||
|
||||
preorder_ctrl = from_timer(preorder_ctrl, t, reordering_ctrl_timer);
|
||||
rtw_reordering_ctrl_timeout_handler(preorder_ctrl);
|
||||
}
|
||||
|
||||
void rtw_init_recv_timer(struct recv_reorder_ctrl *preorder_ctrl)
|
||||
{
|
||||
timer_setup(&preorder_ctrl->reordering_ctrl_timer, _rtw_reordering_ctrl_timeout_handler, 0);
|
||||
}
|
|
@ -4,8 +4,6 @@
|
|||
#include <linux/usb.h>
|
||||
#include "../include/osdep_service.h"
|
||||
#include "../include/drv_types.h"
|
||||
#include "../include/recv_osdep.h"
|
||||
#include "../include/xmit_osdep.h"
|
||||
#include "../include/hal_intf.h"
|
||||
#include "../include/osdep_intf.h"
|
||||
#include "../include/usb_ops.h"
|
||||
|
@ -55,7 +53,7 @@ struct rtw_usb_drv {
|
|||
};
|
||||
|
||||
static struct rtw_usb_drv rtl8188e_usb_drv = {
|
||||
.usbdrv.name = "r8188eu",
|
||||
.usbdrv.name = KBUILD_MODNAME,
|
||||
.usbdrv.probe = rtw_drv_init,
|
||||
.usbdrv.disconnect = rtw_dev_remove,
|
||||
.usbdrv.id_table = rtw_usb_id_tbl,
|
||||
|
@ -232,7 +230,7 @@ static int rtw_suspend(struct usb_interface *pusb_intf, pm_message_t message)
|
|||
mutex_unlock(&pwrpriv->lock);
|
||||
|
||||
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY))
|
||||
rtw_indicate_scan_done(padapter, 1);
|
||||
rtw_indicate_scan_done(padapter);
|
||||
|
||||
if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING))
|
||||
rtw_indicate_disconnect(padapter);
|
||||
|
@ -288,17 +286,17 @@ exit:
|
|||
* We accept the new device by returning 0.
|
||||
*/
|
||||
|
||||
static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
|
||||
struct usb_interface *pusb_intf)
|
||||
static int rtw_usb_if1_init(struct dvobj_priv *dvobj, struct usb_interface *pusb_intf)
|
||||
{
|
||||
struct adapter *padapter = NULL;
|
||||
struct net_device *pnetdev = NULL;
|
||||
struct io_priv *piopriv;
|
||||
struct intf_hdl *pintf;
|
||||
int ret;
|
||||
|
||||
padapter = vzalloc(sizeof(*padapter));
|
||||
if (!padapter)
|
||||
return NULL;
|
||||
return -ENOMEM;
|
||||
|
||||
padapter->dvobj = dvobj;
|
||||
dvobj->if1 = padapter;
|
||||
|
@ -307,12 +305,13 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
|
|||
|
||||
padapter->hw_init_mutex = &usb_drv->hw_init_mutex;
|
||||
|
||||
if (rtw_handle_dualmac(padapter, 1) != _SUCCESS)
|
||||
goto free_adapter;
|
||||
rtw_handle_dualmac(padapter, 1);
|
||||
|
||||
pnetdev = rtw_init_netdev(padapter);
|
||||
if (!pnetdev)
|
||||
if (!pnetdev) {
|
||||
ret = -ENODEV;
|
||||
goto handle_dualmac;
|
||||
}
|
||||
SET_NETDEV_DEV(pnetdev, dvobj_to_dev(dvobj));
|
||||
padapter = rtw_netdev_priv(pnetdev);
|
||||
|
||||
|
@ -330,14 +329,20 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
|
|||
rtl8188e_read_chip_version(padapter);
|
||||
|
||||
/* step usb endpoint mapping */
|
||||
rtl8188eu_interface_configure(padapter);
|
||||
ret = rtl8188eu_interface_configure(padapter);
|
||||
if (ret)
|
||||
goto handle_dualmac;
|
||||
|
||||
/* step read efuse/eeprom data and get mac_addr */
|
||||
ReadAdapterInfo8188EU(padapter);
|
||||
ret = ReadAdapterInfo8188EU(padapter);
|
||||
if (ret)
|
||||
goto handle_dualmac;
|
||||
|
||||
/* step 5. */
|
||||
if (rtw_init_drv_sw(padapter) == _FAIL)
|
||||
if (rtw_init_drv_sw(padapter) == _FAIL) {
|
||||
ret = -ENODEV;
|
||||
goto handle_dualmac;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
if (padapter->pwrctrlpriv.bSupportRemoteWakeup) {
|
||||
|
@ -352,7 +357,8 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
|
|||
usb_autopm_get_interface(pusb_intf);
|
||||
|
||||
/* alloc dev name after read efuse. */
|
||||
if (rtw_init_netdev_name(pnetdev, padapter->registrypriv.ifname) < 0)
|
||||
ret = rtw_init_netdev_name(pnetdev, padapter->registrypriv.ifname);
|
||||
if (ret)
|
||||
goto free_drv_sw;
|
||||
rtw_macaddr_cfg(padapter->eeprompriv.mac_addr);
|
||||
rtw_init_wifidirect_addrs(padapter, padapter->eeprompriv.mac_addr,
|
||||
|
@ -360,23 +366,23 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
|
|||
eth_hw_addr_set(pnetdev, padapter->eeprompriv.mac_addr);
|
||||
|
||||
/* step 6. Tell the network stack we exist */
|
||||
if (register_netdev(pnetdev) != 0)
|
||||
ret = register_netdev(pnetdev);
|
||||
if (ret)
|
||||
goto free_drv_sw;
|
||||
|
||||
return padapter;
|
||||
return 0;
|
||||
|
||||
free_drv_sw:
|
||||
rtw_cancel_all_timer(padapter);
|
||||
rtw_free_drv_sw(padapter);
|
||||
handle_dualmac:
|
||||
rtw_handle_dualmac(padapter, 0);
|
||||
free_adapter:
|
||||
if (pnetdev)
|
||||
rtw_free_netdev(pnetdev);
|
||||
else
|
||||
vfree(padapter);
|
||||
|
||||
return NULL;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void rtw_usb_if1_deinit(struct adapter *if1)
|
||||
|
@ -404,27 +410,24 @@ static void rtw_usb_if1_deinit(struct adapter *if1)
|
|||
|
||||
static int rtw_drv_init(struct usb_interface *pusb_intf, const struct usb_device_id *pdid)
|
||||
{
|
||||
struct adapter *if1 = NULL;
|
||||
struct dvobj_priv *dvobj;
|
||||
int ret;
|
||||
|
||||
/* Initialize dvobj_priv */
|
||||
dvobj = usb_dvobj_init(pusb_intf);
|
||||
if (!dvobj)
|
||||
goto err;
|
||||
return -ENODEV;
|
||||
|
||||
if1 = rtw_usb_if1_init(dvobj, pusb_intf);
|
||||
if (!if1)
|
||||
goto free_dvobj;
|
||||
ret = rtw_usb_if1_init(dvobj, pusb_intf);
|
||||
if (ret) {
|
||||
usb_dvobj_deinit(pusb_intf);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (ui_pid[1] != 0)
|
||||
rtw_signal_process(ui_pid[1], SIGUSR2);
|
||||
|
||||
return 0;
|
||||
|
||||
free_dvobj:
|
||||
usb_dvobj_deinit(pusb_intf);
|
||||
err:
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -1,237 +0,0 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/* Copyright(c) 2007 - 2012 Realtek Corporation. */
|
||||
|
||||
#define _XMIT_OSDEP_C_
|
||||
|
||||
#include "../include/osdep_service.h"
|
||||
#include "../include/drv_types.h"
|
||||
#include "../include/wifi.h"
|
||||
#include "../include/mlme_osdep.h"
|
||||
#include "../include/xmit_osdep.h"
|
||||
#include "../include/osdep_intf.h"
|
||||
#include "../include/usb_osintf.h"
|
||||
|
||||
uint rtw_remainder_len(struct pkt_file *pfile)
|
||||
{
|
||||
return pfile->buf_len - ((size_t)(pfile->cur_addr) -
|
||||
(size_t)(pfile->buf_start));
|
||||
}
|
||||
|
||||
void _rtw_open_pktfile(struct sk_buff *pktptr, struct pkt_file *pfile)
|
||||
{
|
||||
|
||||
if (!pktptr) {
|
||||
pr_err("8188eu: pktptr is NULL\n");
|
||||
return;
|
||||
}
|
||||
if (!pfile) {
|
||||
pr_err("8188eu: pfile is NULL\n");
|
||||
return;
|
||||
}
|
||||
pfile->pkt = pktptr;
|
||||
pfile->cur_addr = pktptr->data;
|
||||
pfile->buf_start = pktptr->data;
|
||||
pfile->pkt_len = pktptr->len;
|
||||
pfile->buf_len = pktptr->len;
|
||||
|
||||
pfile->cur_buffer = pfile->buf_start;
|
||||
|
||||
}
|
||||
|
||||
uint _rtw_pktfile_read(struct pkt_file *pfile, u8 *rmem, uint rlen)
|
||||
{
|
||||
uint len = 0;
|
||||
|
||||
len = rtw_remainder_len(pfile);
|
||||
len = (rlen > len) ? len : rlen;
|
||||
|
||||
if (rmem)
|
||||
skb_copy_bits(pfile->pkt, pfile->buf_len - pfile->pkt_len, rmem, len);
|
||||
|
||||
pfile->cur_addr += len;
|
||||
pfile->pkt_len -= len;
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
bool rtw_endofpktfile(struct pkt_file *pfile)
|
||||
{
|
||||
|
||||
if (pfile->pkt_len == 0) {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
int rtw_os_xmit_resource_alloc(struct adapter *padapter, struct xmit_buf *pxmitbuf, u32 alloc_sz)
|
||||
{
|
||||
pxmitbuf->pallocated_buf = kzalloc(alloc_sz, GFP_KERNEL);
|
||||
if (!pxmitbuf->pallocated_buf)
|
||||
return _FAIL;
|
||||
|
||||
pxmitbuf->pbuf = (u8 *)ALIGN((size_t)(pxmitbuf->pallocated_buf), XMITBUF_ALIGN_SZ);
|
||||
pxmitbuf->dma_transfer_addr = 0;
|
||||
|
||||
pxmitbuf->pxmit_urb = usb_alloc_urb(0, GFP_KERNEL);
|
||||
if (!pxmitbuf->pxmit_urb)
|
||||
return _FAIL;
|
||||
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
void rtw_os_xmit_resource_free(struct adapter *padapter,
|
||||
struct xmit_buf *pxmitbuf, u32 free_sz)
|
||||
{
|
||||
usb_free_urb(pxmitbuf->pxmit_urb);
|
||||
|
||||
kfree(pxmitbuf->pallocated_buf);
|
||||
}
|
||||
|
||||
#define WMM_XMIT_THRESHOLD (NR_XMITFRAME * 2 / 5)
|
||||
|
||||
void rtw_os_pkt_complete(struct adapter *padapter, struct sk_buff *pkt)
|
||||
{
|
||||
u16 queue;
|
||||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
|
||||
queue = skb_get_queue_mapping(pkt);
|
||||
if (padapter->registrypriv.wifi_spec) {
|
||||
if (__netif_subqueue_stopped(padapter->pnetdev, queue) &&
|
||||
(pxmitpriv->hwxmits[queue].accnt < WMM_XMIT_THRESHOLD))
|
||||
netif_wake_subqueue(padapter->pnetdev, queue);
|
||||
} else {
|
||||
if (__netif_subqueue_stopped(padapter->pnetdev, queue))
|
||||
netif_wake_subqueue(padapter->pnetdev, queue);
|
||||
}
|
||||
|
||||
dev_kfree_skb_any(pkt);
|
||||
}
|
||||
|
||||
void rtw_os_xmit_complete(struct adapter *padapter, struct xmit_frame *pxframe)
|
||||
{
|
||||
if (pxframe->pkt)
|
||||
rtw_os_pkt_complete(padapter, pxframe->pkt);
|
||||
pxframe->pkt = NULL;
|
||||
}
|
||||
|
||||
void rtw_os_xmit_schedule(struct adapter *padapter)
|
||||
{
|
||||
struct xmit_priv *pxmitpriv;
|
||||
|
||||
if (!padapter)
|
||||
return;
|
||||
|
||||
pxmitpriv = &padapter->xmitpriv;
|
||||
|
||||
spin_lock_bh(&pxmitpriv->lock);
|
||||
|
||||
if (rtw_txframes_pending(padapter))
|
||||
tasklet_hi_schedule(&pxmitpriv->xmit_tasklet);
|
||||
|
||||
spin_unlock_bh(&pxmitpriv->lock);
|
||||
}
|
||||
|
||||
static void rtw_check_xmit_resource(struct adapter *padapter, struct sk_buff *pkt)
|
||||
{
|
||||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
u16 queue;
|
||||
|
||||
queue = skb_get_queue_mapping(pkt);
|
||||
if (padapter->registrypriv.wifi_spec) {
|
||||
/* No free space for Tx, tx_worker is too slow */
|
||||
if (pxmitpriv->hwxmits[queue].accnt > WMM_XMIT_THRESHOLD)
|
||||
netif_stop_subqueue(padapter->pnetdev, queue);
|
||||
} else {
|
||||
if (pxmitpriv->free_xmitframe_cnt <= 4) {
|
||||
if (!netif_tx_queue_stopped(netdev_get_tx_queue(padapter->pnetdev, queue)))
|
||||
netif_stop_subqueue(padapter->pnetdev, queue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static int rtw_mlcst2unicst(struct adapter *padapter, struct sk_buff *skb)
|
||||
{
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
struct list_head *phead, *plist;
|
||||
struct sk_buff *newskb;
|
||||
struct sta_info *psta = NULL;
|
||||
s32 res;
|
||||
|
||||
spin_lock_bh(&pstapriv->asoc_list_lock);
|
||||
phead = &pstapriv->asoc_list;
|
||||
plist = phead->next;
|
||||
|
||||
/* free sta asoc_queue */
|
||||
while (phead != plist) {
|
||||
psta = container_of(plist, struct sta_info, asoc_list);
|
||||
|
||||
plist = plist->next;
|
||||
|
||||
/* avoid come from STA1 and send back STA1 */
|
||||
if (!memcmp(psta->hwaddr, &skb->data[6], 6))
|
||||
continue;
|
||||
|
||||
newskb = skb_copy(skb, GFP_ATOMIC);
|
||||
|
||||
if (newskb) {
|
||||
memcpy(newskb->data, psta->hwaddr, 6);
|
||||
res = rtw_xmit(padapter, &newskb);
|
||||
if (res < 0) {
|
||||
pxmitpriv->tx_drop++;
|
||||
dev_kfree_skb_any(newskb);
|
||||
} else {
|
||||
pxmitpriv->tx_pkts++;
|
||||
}
|
||||
} else {
|
||||
pxmitpriv->tx_drop++;
|
||||
|
||||
spin_unlock_bh(&pstapriv->asoc_list_lock);
|
||||
return false; /* Caller shall tx this multicast frame via normal way. */
|
||||
}
|
||||
}
|
||||
|
||||
spin_unlock_bh(&pstapriv->asoc_list_lock);
|
||||
dev_kfree_skb_any(skb);
|
||||
return true;
|
||||
}
|
||||
|
||||
int rtw_xmit_entry(struct sk_buff *pkt, struct net_device *pnetdev)
|
||||
{
|
||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(pnetdev);
|
||||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
s32 res = 0;
|
||||
|
||||
if (!rtw_if_up(padapter))
|
||||
goto drop_packet;
|
||||
|
||||
rtw_check_xmit_resource(padapter, pkt);
|
||||
|
||||
if (!rtw_mc2u_disable && check_fwstate(pmlmepriv, WIFI_AP_STATE) &&
|
||||
(IP_MCAST_MAC(pkt->data) || ICMPV6_MCAST_MAC(pkt->data)) &&
|
||||
(padapter->registrypriv.wifi_spec == 0)) {
|
||||
if (pxmitpriv->free_xmitframe_cnt > (NR_XMITFRAME / 4)) {
|
||||
res = rtw_mlcst2unicst(padapter, pkt);
|
||||
if (res)
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
|
||||
res = rtw_xmit(padapter, &pkt);
|
||||
if (res < 0)
|
||||
goto drop_packet;
|
||||
|
||||
pxmitpriv->tx_pkts++;
|
||||
goto exit;
|
||||
|
||||
drop_packet:
|
||||
pxmitpriv->tx_drop++;
|
||||
dev_kfree_skb_any(pkt);
|
||||
|
||||
exit:
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -10,6 +10,9 @@ config RTLLIB
|
|||
|
||||
If unsure, say N.
|
||||
|
||||
This driver adds support for rtllib wireless cards.
|
||||
Only the rtl8192e is supported as of now.
|
||||
|
||||
if RTLLIB
|
||||
|
||||
config RTLLIB_CRYPTO_CCMP
|
||||
|
@ -23,6 +26,8 @@ config RTLLIB_CRYPTO_CCMP
|
|||
CCMP crypto driver for rtllib.
|
||||
|
||||
If you enabled RTLLIB, you want this.
|
||||
Adds support for the CCM mode Protocol crypto driver for
|
||||
use in wireless cards (including rtllib cards).
|
||||
|
||||
config RTLLIB_CRYPTO_TKIP
|
||||
tristate "Support for rtllib TKIP crypto"
|
||||
|
@ -35,6 +40,8 @@ config RTLLIB_CRYPTO_TKIP
|
|||
TKIP crypto driver for rtllib.
|
||||
|
||||
If you enabled RTLLIB, you want this.
|
||||
Adds support for the Temporal Key Integrity Protocol for
|
||||
the IEEE 802.11i standard for use on wireless cards.
|
||||
|
||||
config RTLLIB_CRYPTO_WEP
|
||||
tristate "Support for rtllib WEP crypto"
|
||||
|
@ -42,9 +49,12 @@ config RTLLIB_CRYPTO_WEP
|
|||
depends on RTLLIB
|
||||
default y
|
||||
help
|
||||
TKIP crypto driver for rtllib.
|
||||
WEP crypto driver for rtllib.
|
||||
|
||||
If you enabled RTLLIB, you want this.
|
||||
Adds support for the (now weak) Wired Equivalent Privacy
|
||||
(WEP) crypto protocol for wireless cards.
|
||||
NOTE: This protocol is now considered insecure.
|
||||
|
||||
source "drivers/staging/rtl8192e/rtl8192e/Kconfig"
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#include "r8190P_rtl8256.h"
|
||||
|
||||
void rtl92e_set_bandwidth(struct net_device *dev,
|
||||
enum ht_channel_width Bandwidth)
|
||||
enum ht_channel_width bandwidth)
|
||||
{
|
||||
u8 eRFPath;
|
||||
struct r8192_priv *priv = rtllib_priv(dev);
|
||||
|
@ -25,7 +25,7 @@ void rtl92e_set_bandwidth(struct net_device *dev,
|
|||
if (!rtl92e_is_legal_rf_path(dev, eRFPath))
|
||||
continue;
|
||||
|
||||
switch (Bandwidth) {
|
||||
switch (bandwidth) {
|
||||
case HT_CHANNEL_WIDTH_20:
|
||||
rtl92e_set_rf_reg(dev, (enum rf90_radio_path)eRFPath,
|
||||
0x0b, bMask12Bits, 0x100);
|
||||
|
@ -44,7 +44,7 @@ void rtl92e_set_bandwidth(struct net_device *dev,
|
|||
break;
|
||||
default:
|
||||
netdev_err(dev, "%s(): Unknown bandwidth: %#X\n",
|
||||
__func__, Bandwidth);
|
||||
__func__, bandwidth);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -115,10 +115,6 @@ bool rtl92e_config_rf(struct net_device *dev)
|
|||
(enum rf90_radio_path)eRFPath,
|
||||
RegOffSetToBeCheck,
|
||||
bMask12Bits);
|
||||
RT_TRACE(COMP_RF,
|
||||
"RF %d %d register final value: %x\n",
|
||||
eRFPath, RegOffSetToBeCheck,
|
||||
RF3_Final_Value);
|
||||
RetryTimes--;
|
||||
}
|
||||
|
||||
|
@ -142,8 +138,6 @@ bool rtl92e_config_rf(struct net_device *dev)
|
|||
goto fail;
|
||||
}
|
||||
}
|
||||
|
||||
RT_TRACE(COMP_PHY, "PHY Initialization Success\n");
|
||||
return true;
|
||||
|
||||
fail:
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#define RTL819X_TOTAL_RF_PATH 2
|
||||
void rtl92e_set_bandwidth(struct net_device *dev,
|
||||
enum ht_channel_width Bandwidth);
|
||||
enum ht_channel_width bandwidth);
|
||||
bool rtl92e_config_rf(struct net_device *dev);
|
||||
void rtl92e_set_cck_tx_power(struct net_device *dev, u8 powerlevel);
|
||||
void rtl92e_set_ofdm_tx_power(struct net_device *dev, u8 powerlevel);
|
||||
|
|
|
@ -21,8 +21,6 @@ bool rtl92e_send_cmd_pkt(struct net_device *dev, u32 type, const void *data,
|
|||
|
||||
struct tx_fwinfo_8190pci *pTxFwInfo = NULL;
|
||||
|
||||
RT_TRACE(COMP_CMDPKT, "%s(),buffer_len is %d\n", __func__, len);
|
||||
|
||||
do {
|
||||
if ((len - frag_offset) > CMDPACKET_FRAG_SIZE) {
|
||||
frag_length = CMDPACKET_FRAG_SIZE;
|
||||
|
@ -61,8 +59,7 @@ bool rtl92e_send_cmd_pkt(struct net_device *dev, u32 type, const void *data,
|
|||
tcb_desc->txbuf_size = frag_length;
|
||||
}
|
||||
|
||||
seg_ptr = skb_put(skb, frag_length);
|
||||
memcpy(seg_ptr, data, (u32)frag_length);
|
||||
skb_put_data(skb, data, frag_length);
|
||||
|
||||
if (type == DESC_PACKET_TYPE_INIT &&
|
||||
(!priv->rtllib->check_nic_enough_desc(dev, TXCMD_QUEUE) ||
|
||||
|
|
|
@ -186,8 +186,6 @@ void rtl92e_set_reg(struct net_device *dev, u8 variable, u8 *val)
|
|||
AC_PARAM_ECW_MIN_OFFSET) |
|
||||
(((u32)u1bAIFS) << AC_PARAM_AIFS_OFFSET);
|
||||
|
||||
RT_TRACE(COMP_DBG, "%s():HW_VAR_AC_PARAM eACI:%x:%x\n",
|
||||
__func__, eACI, u4bAcParam);
|
||||
switch (eACI) {
|
||||
case AC1_BK:
|
||||
rtl92e_writel(dev, EDCAPARA_BK, u4bAcParam);
|
||||
|
@ -226,8 +224,6 @@ void rtl92e_set_reg(struct net_device *dev, u8 variable, u8 *val)
|
|||
u8 acm = pAciAifsn->f.acm;
|
||||
u8 AcmCtrl = rtl92e_readb(dev, AcmHwCtrl);
|
||||
|
||||
RT_TRACE(COMP_DBG, "===========>%s():HW_VAR_ACM_CTRL:%x\n",
|
||||
__func__, eACI);
|
||||
AcmCtrl = AcmCtrl | ((priv->AcmMethod == 2) ? 0x0 : 0x1);
|
||||
|
||||
if (acm) {
|
||||
|
@ -243,12 +239,6 @@ void rtl92e_set_reg(struct net_device *dev, u8 variable, u8 *val)
|
|||
case AC3_VO:
|
||||
AcmCtrl |= AcmHw_VoqEn;
|
||||
break;
|
||||
|
||||
default:
|
||||
RT_TRACE(COMP_QOS,
|
||||
"SetHwReg8185(): [HW_VAR_ACM_CTRL] acm set failed: eACI is %d\n",
|
||||
eACI);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
switch (eACI) {
|
||||
|
@ -268,10 +258,6 @@ void rtl92e_set_reg(struct net_device *dev, u8 variable, u8 *val)
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
RT_TRACE(COMP_QOS,
|
||||
"SetHwReg8190pci(): [HW_VAR_ACM_CTRL] Write 0x%X\n",
|
||||
AcmCtrl);
|
||||
rtl92e_writeb(dev, AcmHwCtrl, AcmCtrl);
|
||||
break;
|
||||
}
|
||||
|
@ -304,8 +290,6 @@ static void _rtl92e_read_eeprom_info(struct net_device *dev)
|
|||
u16 i, usValue, IC_Version;
|
||||
u16 EEPROMId;
|
||||
|
||||
RT_TRACE(COMP_INIT, "====> %s\n", __func__);
|
||||
|
||||
EEPROMId = rtl92e_eeprom_read(dev, 0);
|
||||
if (EEPROMId != RTL8190_EEPROM_ID) {
|
||||
netdev_err(dev, "%s(): Invalid EEPROM ID: %x\n", __func__,
|
||||
|
@ -329,8 +313,6 @@ static void _rtl92e_read_eeprom_info(struct net_device *dev)
|
|||
|
||||
ICVer8192 = IC_Version & 0xf;
|
||||
ICVer8256 = (IC_Version & 0xf0)>>4;
|
||||
RT_TRACE(COMP_INIT, "\nICVer8192 = 0x%x\n", ICVer8192);
|
||||
RT_TRACE(COMP_INIT, "\nICVer8256 = 0x%x\n", ICVer8256);
|
||||
if (ICVer8192 == 0x2) {
|
||||
if (ICVer8256 == 0x5)
|
||||
priv->card_8192_version = VERSION_8190_BE;
|
||||
|
@ -343,22 +325,14 @@ static void _rtl92e_read_eeprom_info(struct net_device *dev)
|
|||
priv->card_8192_version = VERSION_8190_BD;
|
||||
break;
|
||||
}
|
||||
RT_TRACE(COMP_INIT, "\nIC Version = 0x%x\n",
|
||||
priv->card_8192_version);
|
||||
} else {
|
||||
priv->card_8192_version = VERSION_8190_BD;
|
||||
priv->eeprom_vid = 0;
|
||||
priv->eeprom_did = 0;
|
||||
priv->eeprom_CustomerID = 0;
|
||||
priv->eeprom_ChannelPlan = 0;
|
||||
RT_TRACE(COMP_INIT, "\nIC Version = 0x%x\n", 0xff);
|
||||
}
|
||||
|
||||
RT_TRACE(COMP_INIT, "EEPROM VID = 0x%4x\n", priv->eeprom_vid);
|
||||
RT_TRACE(COMP_INIT, "EEPROM DID = 0x%4x\n", priv->eeprom_did);
|
||||
RT_TRACE(COMP_INIT, "EEPROM Customer ID: 0x%2x\n",
|
||||
priv->eeprom_CustomerID);
|
||||
|
||||
if (!priv->AutoloadFailFlag) {
|
||||
u8 addr[ETH_ALEN];
|
||||
|
||||
|
@ -372,9 +346,6 @@ static void _rtl92e_read_eeprom_info(struct net_device *dev)
|
|||
eth_hw_addr_set(dev, bMac_Tmp_Addr);
|
||||
}
|
||||
|
||||
RT_TRACE(COMP_INIT, "Permanent Address = %pM\n",
|
||||
dev->dev_addr);
|
||||
|
||||
if (priv->card_8192_version > VERSION_8190_BD)
|
||||
priv->bTXPowerDataReadFromEEPORM = true;
|
||||
else
|
||||
|
@ -395,8 +366,6 @@ static void _rtl92e_read_eeprom_info(struct net_device *dev)
|
|||
} else {
|
||||
priv->EEPROMLegacyHTTxPowerDiff = 0x04;
|
||||
}
|
||||
RT_TRACE(COMP_INIT, "EEPROMLegacyHTTxPowerDiff = %d\n",
|
||||
priv->EEPROMLegacyHTTxPowerDiff);
|
||||
|
||||
if (!priv->AutoloadFailFlag)
|
||||
priv->EEPROMThermalMeter = ((rtl92e_eeprom_read(dev,
|
||||
|
@ -404,8 +373,6 @@ static void _rtl92e_read_eeprom_info(struct net_device *dev)
|
|||
0xff00) >> 8;
|
||||
else
|
||||
priv->EEPROMThermalMeter = EEPROM_Default_ThermalMeter;
|
||||
RT_TRACE(COMP_INIT, "ThermalMeter = %d\n",
|
||||
priv->EEPROMThermalMeter);
|
||||
priv->TSSI_13dBm = priv->EEPROMThermalMeter * 100;
|
||||
|
||||
if (priv->epromtype == EEPROM_93C46) {
|
||||
|
@ -421,10 +388,6 @@ static void _rtl92e_read_eeprom_info(struct net_device *dev)
|
|||
priv->EEPROMCrystalCap =
|
||||
EEPROM_Default_TxPwDiff_CrystalCap;
|
||||
}
|
||||
RT_TRACE(COMP_INIT, "EEPROMAntPwDiff = %d\n",
|
||||
priv->EEPROMAntPwDiff);
|
||||
RT_TRACE(COMP_INIT, "EEPROMCrystalCap = %d\n",
|
||||
priv->EEPROMCrystalCap);
|
||||
|
||||
for (i = 0; i < 14; i += 2) {
|
||||
if (!priv->AutoloadFailFlag)
|
||||
|
@ -434,12 +397,6 @@ static void _rtl92e_read_eeprom_info(struct net_device *dev)
|
|||
usValue = EEPROM_Default_TxPower;
|
||||
*((u16 *)(&priv->EEPROMTxPowerLevelCCK[i])) =
|
||||
usValue;
|
||||
RT_TRACE(COMP_INIT,
|
||||
"CCK Tx Power Level, Index %d = 0x%02x\n",
|
||||
i, priv->EEPROMTxPowerLevelCCK[i]);
|
||||
RT_TRACE(COMP_INIT,
|
||||
"CCK Tx Power Level, Index %d = 0x%02x\n",
|
||||
i+1, priv->EEPROMTxPowerLevelCCK[i+1]);
|
||||
}
|
||||
for (i = 0; i < 14; i += 2) {
|
||||
if (!priv->AutoloadFailFlag)
|
||||
|
@ -449,13 +406,6 @@ static void _rtl92e_read_eeprom_info(struct net_device *dev)
|
|||
usValue = EEPROM_Default_TxPower;
|
||||
*((u16 *)(&priv->EEPROMTxPowerLevelOFDM24G[i]))
|
||||
= usValue;
|
||||
RT_TRACE(COMP_INIT,
|
||||
"OFDM 2.4G Tx Power Level, Index %d = 0x%02x\n",
|
||||
i, priv->EEPROMTxPowerLevelOFDM24G[i]);
|
||||
RT_TRACE(COMP_INIT,
|
||||
"OFDM 2.4G Tx Power Level, Index %d = 0x%02x\n",
|
||||
i + 1,
|
||||
priv->EEPROMTxPowerLevelOFDM24G[i+1]);
|
||||
}
|
||||
}
|
||||
if (priv->epromtype == EEPROM_93C46) {
|
||||
|
@ -508,22 +458,6 @@ static void _rtl92e_read_eeprom_info(struct net_device *dev)
|
|||
priv->TxPowerLevelOFDM24G_C[i] =
|
||||
priv->EEPROMRfCOfdmChnlTxPwLevel[2];
|
||||
}
|
||||
for (i = 0; i < 14; i++)
|
||||
RT_TRACE(COMP_INIT,
|
||||
"priv->TxPowerLevelCCK_A[%d] = 0x%x\n",
|
||||
i, priv->TxPowerLevelCCK_A[i]);
|
||||
for (i = 0; i < 14; i++)
|
||||
RT_TRACE(COMP_INIT,
|
||||
"priv->TxPowerLevelOFDM24G_A[%d] = 0x%x\n",
|
||||
i, priv->TxPowerLevelOFDM24G_A[i]);
|
||||
for (i = 0; i < 14; i++)
|
||||
RT_TRACE(COMP_INIT,
|
||||
"priv->TxPowerLevelCCK_C[%d] = 0x%x\n",
|
||||
i, priv->TxPowerLevelCCK_C[i]);
|
||||
for (i = 0; i < 14; i++)
|
||||
RT_TRACE(COMP_INIT,
|
||||
"priv->TxPowerLevelOFDM24G_C[%d] = 0x%x\n",
|
||||
i, priv->TxPowerLevelOFDM24G_C[i]);
|
||||
priv->LegacyHTTxPowerDiff =
|
||||
priv->EEPROMLegacyHTTxPowerDiff;
|
||||
priv->AntennaTxPwDiff[0] = 0;
|
||||
|
@ -536,13 +470,6 @@ static void _rtl92e_read_eeprom_info(struct net_device *dev)
|
|||
}
|
||||
}
|
||||
|
||||
if (priv->rf_type == RF_1T2R) {
|
||||
/* no matter what checkpatch says, the braces are needed */
|
||||
RT_TRACE(COMP_INIT, "\n1T2R config\n");
|
||||
} else if (priv->rf_type == RF_2T4R) {
|
||||
RT_TRACE(COMP_INIT, "\n2T4R config\n");
|
||||
}
|
||||
|
||||
rtl92e_init_adaptive_rate(dev);
|
||||
|
||||
priv->rf_chip = RF_8256;
|
||||
|
@ -574,8 +501,6 @@ static void _rtl92e_read_eeprom_info(struct net_device *dev)
|
|||
priv->ChannelPlan = priv->eeprom_ChannelPlan&0x7f;
|
||||
else
|
||||
priv->ChannelPlan = 0x0;
|
||||
RT_TRACE(COMP_INIT, "Toshiba ChannelPlan = 0x%x\n",
|
||||
priv->ChannelPlan);
|
||||
break;
|
||||
case EEPROM_CID_Nettronix:
|
||||
priv->ScanDelay = 100;
|
||||
|
@ -602,10 +527,6 @@ static void _rtl92e_read_eeprom_info(struct net_device *dev)
|
|||
priv->rtllib->bSupportRemoteWakeUp = true;
|
||||
else
|
||||
priv->rtllib->bSupportRemoteWakeUp = false;
|
||||
|
||||
RT_TRACE(COMP_INIT, "RegChannelPlan(%d)\n", priv->RegChannelPlan);
|
||||
RT_TRACE(COMP_INIT, "ChannelPlan = %d\n", priv->ChannelPlan);
|
||||
RT_TRACE(COMP_TRACE, "<==== ReadAdapterInfo\n");
|
||||
}
|
||||
|
||||
void rtl92e_get_eeprom_size(struct net_device *dev)
|
||||
|
@ -613,14 +534,9 @@ void rtl92e_get_eeprom_size(struct net_device *dev)
|
|||
u16 curCR;
|
||||
struct r8192_priv *priv = rtllib_priv(dev);
|
||||
|
||||
RT_TRACE(COMP_INIT, "===========>%s()\n", __func__);
|
||||
curCR = rtl92e_readw(dev, EPROM_CMD);
|
||||
RT_TRACE(COMP_INIT, "read from Reg Cmd9346CR(%x):%x\n", EPROM_CMD,
|
||||
curCR);
|
||||
priv->epromtype = (curCR & EPROM_CMD_9356SEL) ? EEPROM_93C56 :
|
||||
EEPROM_93C46;
|
||||
RT_TRACE(COMP_INIT, "<===========%s(), epromtype:%d\n", __func__,
|
||||
priv->epromtype);
|
||||
_rtl92e_read_eeprom_info(dev);
|
||||
}
|
||||
|
||||
|
@ -697,7 +613,6 @@ bool rtl92e_start_adapter(struct net_device *dev)
|
|||
int i = 0;
|
||||
u32 retry_times = 0;
|
||||
|
||||
RT_TRACE(COMP_INIT, "====>%s()\n", __func__);
|
||||
priv->being_init_adapter = true;
|
||||
|
||||
start:
|
||||
|
@ -710,7 +625,7 @@ start:
|
|||
priv->pFirmware->status = FW_STATUS_0_INIT;
|
||||
|
||||
if (priv->RegRfOff)
|
||||
priv->rtllib->eRFPowerState = eRfOff;
|
||||
priv->rtllib->rf_power_state = rf_off;
|
||||
|
||||
ulRegRead = rtl92e_readl(dev, CPU_GEN);
|
||||
if (priv->pFirmware->status == FW_STATUS_0_INIT)
|
||||
|
@ -732,13 +647,11 @@ start:
|
|||
rtl92e_writeb(dev, SWREGULATOR, 0xb8);
|
||||
}
|
||||
}
|
||||
RT_TRACE(COMP_INIT, "BB Config Start!\n");
|
||||
rtStatus = rtl92e_config_bb(dev);
|
||||
if (!rtStatus) {
|
||||
netdev_warn(dev, "%s(): Failed to configure BB\n", __func__);
|
||||
return rtStatus;
|
||||
}
|
||||
RT_TRACE(COMP_INIT, "BB Config Finished!\n");
|
||||
|
||||
priv->LoopbackMode = RTL819X_NO_LOOPBACK;
|
||||
if (priv->ResetProgress == RESET_TYPE_NORESET) {
|
||||
|
@ -818,19 +731,7 @@ start:
|
|||
|
||||
tmpvalue = rtl92e_readb(dev, IC_VERRSION);
|
||||
priv->IC_Cut = tmpvalue;
|
||||
RT_TRACE(COMP_INIT, "priv->IC_Cut= 0x%x\n", priv->IC_Cut);
|
||||
if (priv->IC_Cut >= IC_VersionCut_D) {
|
||||
if (priv->IC_Cut == IC_VersionCut_D) {
|
||||
/* no matter what checkpatch says, braces are needed */
|
||||
RT_TRACE(COMP_INIT, "D-cut\n");
|
||||
} else if (priv->IC_Cut == IC_VersionCut_E) {
|
||||
RT_TRACE(COMP_INIT, "E-cut\n");
|
||||
}
|
||||
} else {
|
||||
RT_TRACE(COMP_INIT, "Before C-cut\n");
|
||||
}
|
||||
|
||||
RT_TRACE(COMP_INIT, "Load Firmware!\n");
|
||||
bfirmwareok = rtl92e_init_fw(dev);
|
||||
if (!bfirmwareok) {
|
||||
if (retry_times < 10) {
|
||||
|
@ -841,15 +742,13 @@ start:
|
|||
goto end;
|
||||
}
|
||||
}
|
||||
RT_TRACE(COMP_INIT, "Load Firmware finished!\n");
|
||||
|
||||
if (priv->ResetProgress == RESET_TYPE_NORESET) {
|
||||
RT_TRACE(COMP_INIT, "RF Config Started!\n");
|
||||
rtStatus = rtl92e_config_phy(dev);
|
||||
if (!rtStatus) {
|
||||
netdev_info(dev, "RF Config failed\n");
|
||||
return rtStatus;
|
||||
}
|
||||
RT_TRACE(COMP_INIT, "RF Config Finished!\n");
|
||||
}
|
||||
|
||||
rtl92e_set_bb_reg(dev, rFPGA0_RFMOD, bCCKEn, 0x1);
|
||||
|
@ -858,25 +757,14 @@ start:
|
|||
rtl92e_writeb(dev, 0x87, 0x0);
|
||||
|
||||
if (priv->RegRfOff) {
|
||||
RT_TRACE((COMP_INIT | COMP_RF | COMP_POWER),
|
||||
"%s(): Turn off RF for RegRfOff ----------\n",
|
||||
__func__);
|
||||
rtl92e_set_rf_state(dev, eRfOff, RF_CHANGE_BY_SW);
|
||||
} else if (priv->rtllib->RfOffReason > RF_CHANGE_BY_PS) {
|
||||
RT_TRACE((COMP_INIT|COMP_RF|COMP_POWER),
|
||||
"%s(): Turn off RF for RfOffReason(%d) ----------\n",
|
||||
__func__, priv->rtllib->RfOffReason);
|
||||
rtl92e_set_rf_state(dev, eRfOff, priv->rtllib->RfOffReason);
|
||||
} else if (priv->rtllib->RfOffReason >= RF_CHANGE_BY_IPS) {
|
||||
RT_TRACE((COMP_INIT|COMP_RF|COMP_POWER),
|
||||
"%s(): Turn off RF for RfOffReason(%d) ----------\n",
|
||||
__func__, priv->rtllib->RfOffReason);
|
||||
rtl92e_set_rf_state(dev, eRfOff, priv->rtllib->RfOffReason);
|
||||
rtl92e_set_rf_state(dev, rf_off, RF_CHANGE_BY_SW);
|
||||
} else if (priv->rtllib->rf_off_reason > RF_CHANGE_BY_PS) {
|
||||
rtl92e_set_rf_state(dev, rf_off, priv->rtllib->rf_off_reason);
|
||||
} else if (priv->rtllib->rf_off_reason >= RF_CHANGE_BY_IPS) {
|
||||
rtl92e_set_rf_state(dev, rf_off, priv->rtllib->rf_off_reason);
|
||||
} else {
|
||||
RT_TRACE((COMP_INIT|COMP_RF|COMP_POWER), "%s(): RF-ON\n",
|
||||
__func__);
|
||||
priv->rtllib->eRFPowerState = eRfOn;
|
||||
priv->rtllib->RfOffReason = 0;
|
||||
priv->rtllib->rf_power_state = rf_on;
|
||||
priv->rtllib->rf_off_reason = 0;
|
||||
}
|
||||
|
||||
if (priv->rtllib->FwRWRF)
|
||||
|
@ -915,18 +803,6 @@ start:
|
|||
priv->CCKPresentAttentuation_difference = 0;
|
||||
priv->CCKPresentAttentuation =
|
||||
priv->CCKPresentAttentuation_20Mdefault;
|
||||
RT_TRACE(COMP_POWER_TRACKING,
|
||||
"priv->rfa_txpowertrackingindex_initial = %d\n",
|
||||
priv->rfa_txpowertrackingindex);
|
||||
RT_TRACE(COMP_POWER_TRACKING,
|
||||
"priv->rfa_txpowertrackingindex_real__initial = %d\n",
|
||||
priv->rfa_txpowertrackingindex_real);
|
||||
RT_TRACE(COMP_POWER_TRACKING,
|
||||
"priv->CCKPresentAttentuation_difference_initial = %d\n",
|
||||
priv->CCKPresentAttentuation_difference);
|
||||
RT_TRACE(COMP_POWER_TRACKING,
|
||||
"priv->CCKPresentAttentuation_initial = %d\n",
|
||||
priv->CCKPresentAttentuation);
|
||||
priv->btxpower_tracking = false;
|
||||
}
|
||||
}
|
||||
|
@ -946,7 +822,7 @@ static void _rtl92e_net_update(struct net_device *dev)
|
|||
|
||||
net = &priv->rtllib->current_network;
|
||||
rtl92e_config_rate(dev, &rate_config);
|
||||
priv->dot11CurrentPreambleMode = PREAMBLE_AUTO;
|
||||
priv->dot11_current_preamble_mode = PREAMBLE_AUTO;
|
||||
priv->basic_rate = rate_config &= 0x15f;
|
||||
rtl92e_writew(dev, BSSIDR, *(u16 *)net->bssid);
|
||||
rtl92e_writel(dev, BSSIDR + 2, *(u32 *)(net->bssid + 2));
|
||||
|
@ -1237,7 +1113,6 @@ void rtl92e_fill_tx_desc(struct net_device *dev, struct tx_desc *pdesc,
|
|||
static u8 tmp;
|
||||
|
||||
if (!tmp) {
|
||||
RT_TRACE(COMP_DBG, "==>================hw sec\n");
|
||||
tmp = 1;
|
||||
}
|
||||
switch (priv->rtllib->pairwise_key_type) {
|
||||
|
@ -1350,12 +1225,6 @@ static u8 _rtl92e_rate_hw_to_mgn(bool bIsHT, u8 rate)
|
|||
case DESC90_RATE54M:
|
||||
ret_rate = MGN_54M;
|
||||
break;
|
||||
|
||||
default:
|
||||
RT_TRACE(COMP_RECV,
|
||||
"%s: Non supportedRate [%x], bIsHT = %d!!!\n",
|
||||
__func__, rate, bIsHT);
|
||||
break;
|
||||
}
|
||||
|
||||
} else {
|
||||
|
@ -1411,12 +1280,6 @@ static u8 _rtl92e_rate_hw_to_mgn(bool bIsHT, u8 rate)
|
|||
case DESC90_RATEMCS32:
|
||||
ret_rate = 0x80 | 0x20;
|
||||
break;
|
||||
|
||||
default:
|
||||
RT_TRACE(COMP_RECV,
|
||||
"%s: Non supported Rate [%x], bIsHT = %d!!!\n",
|
||||
__func__, rate, bIsHT);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1721,9 +1584,6 @@ static void _rtl92e_process_phyinfo(struct r8192_priv *priv, u8 *buffer,
|
|||
for (rfpath = RF90_PATH_A; rfpath < RF90_PATH_C; rfpath++) {
|
||||
if (!rtl92e_is_legal_rf_path(priv->rtllib->dev, rfpath))
|
||||
continue;
|
||||
RT_TRACE(COMP_DBG,
|
||||
"Jacken -> pPreviousstats->RxMIMOSignalStrength[rfpath] = %d\n",
|
||||
prev_st->RxMIMOSignalStrength[rfpath]);
|
||||
if (priv->stats.rx_rssi_percentage[rfpath] == 0) {
|
||||
priv->stats.rx_rssi_percentage[rfpath] =
|
||||
prev_st->RxMIMOSignalStrength[rfpath];
|
||||
|
@ -1745,9 +1605,6 @@ static void _rtl92e_process_phyinfo(struct r8192_priv *priv, u8 *buffer,
|
|||
(prev_st->RxMIMOSignalStrength[rfpath])) /
|
||||
(RX_SMOOTH);
|
||||
}
|
||||
RT_TRACE(COMP_DBG,
|
||||
"Jacken -> priv->RxStats.RxRSSIPercentage[rfPath] = %d\n",
|
||||
priv->stats.rx_rssi_percentage[rfpath]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1772,11 +1629,6 @@ static void _rtl92e_process_phyinfo(struct r8192_priv *priv, u8 *buffer,
|
|||
if (prev_st->RxPWDBAll >= 3)
|
||||
prev_st->RxPWDBAll -= 3;
|
||||
}
|
||||
|
||||
RT_TRACE(COMP_RXDESC, "Smooth %s PWDB = %d\n",
|
||||
prev_st->bIsCCK ? "CCK" : "OFDM",
|
||||
prev_st->RxPWDBAll);
|
||||
|
||||
if (prev_st->bPacketToSelf || prev_st->bPacketBeacon ||
|
||||
prev_st->bToSelfBA) {
|
||||
if (priv->undecorated_smoothed_pwdb < 0)
|
||||
|
@ -2052,11 +1904,6 @@ bool rtl92e_get_rx_stats(struct net_device *dev, struct rtllib_rx_stats *stats,
|
|||
stats->RxIs40MHzPacket = pDrvInfo->BW;
|
||||
|
||||
_rtl92e_translate_rx_signal_stats(dev, skb, stats, pdesc, pDrvInfo);
|
||||
|
||||
if (pDrvInfo->FirstAGGR == 1 || pDrvInfo->PartAggr == 1)
|
||||
RT_TRACE(COMP_RXDESC,
|
||||
"pDrvInfo->FirstAGGR = %d, pDrvInfo->PartAggr = %d\n",
|
||||
pDrvInfo->FirstAGGR, pDrvInfo->PartAggr);
|
||||
skb_trim(skb, skb->len - 4/*sCrcLng*/);
|
||||
|
||||
|
||||
|
@ -2138,7 +1985,7 @@ void rtl92e_update_ratr_table(struct net_device *dev)
|
|||
break;
|
||||
case IEEE_N_24G:
|
||||
case IEEE_N_5G:
|
||||
if (ieee->pHTInfo->PeerMimoPs == 0) {
|
||||
if (ieee->pHTInfo->peer_mimo_ps == 0) {
|
||||
ratr_value &= 0x0007F007;
|
||||
} else {
|
||||
if (priv->rf_type == RF_1T2R)
|
||||
|
@ -2151,10 +1998,10 @@ void rtl92e_update_ratr_table(struct net_device *dev)
|
|||
break;
|
||||
}
|
||||
ratr_value &= 0x0FFFFFFF;
|
||||
if (ieee->pHTInfo->bCurTxBW40MHz &&
|
||||
if (ieee->pHTInfo->cur_tx_bw40mhz &&
|
||||
ieee->pHTInfo->bCurShortGI40MHz)
|
||||
ratr_value |= 0x80000000;
|
||||
else if (!ieee->pHTInfo->bCurTxBW40MHz &&
|
||||
else if (!ieee->pHTInfo->cur_tx_bw40mhz &&
|
||||
ieee->pHTInfo->bCurShortGI20MHz)
|
||||
ratr_value |= 0x80000000;
|
||||
rtl92e_writel(dev, RATR0+rate_index*4, ratr_value);
|
||||
|
@ -2261,9 +2108,6 @@ bool rtl92e_is_rx_stuck(struct net_device *dev)
|
|||
u8 i;
|
||||
u8 SilentResetRxSoltNum = 4;
|
||||
|
||||
RT_TRACE(COMP_RESET, "%s(): RegRxCounter is %d, RxCounter is %d\n",
|
||||
__func__, RegRxCounter, priv->RxCounter);
|
||||
|
||||
rx_chk_cnt++;
|
||||
if (priv->undecorated_smoothed_pwdb >= (RateAdaptiveTH_High+5)) {
|
||||
rx_chk_cnt = 0;
|
||||
|
@ -2321,9 +2165,6 @@ bool rtl92e_is_tx_stuck(struct net_device *dev)
|
|||
bool bStuck = false;
|
||||
u16 RegTxCounter = rtl92e_readw(dev, 0x128);
|
||||
|
||||
RT_TRACE(COMP_RESET, "%s():RegTxCounter is %d,TxCounter is %d\n",
|
||||
__func__, RegTxCounter, priv->TxCounter);
|
||||
|
||||
if (priv->TxCounter == RegTxCounter)
|
||||
bStuck = true;
|
||||
|
||||
|
|
|
@ -77,10 +77,6 @@ static bool _rtl92e_fw_check_ready(struct net_device *dev,
|
|||
rt_status = _rtl92e_wait_for_fw(dev, CPU_GEN_FIRM_RDY, 20);
|
||||
if (rt_status)
|
||||
pfirmware->status = FW_STATUS_5_READY;
|
||||
else
|
||||
RT_TRACE(COMP_FIRMWARE,
|
||||
"_rtl92e_is_fw_ready fail(%d)!\n",
|
||||
rt_status);
|
||||
break;
|
||||
default:
|
||||
rt_status = false;
|
||||
|
@ -149,9 +145,6 @@ bool rtl92e_init_fw(struct net_device *dev)
|
|||
} else if (pfirmware->status == FW_STATUS_5_READY) {
|
||||
rst_opt = OPT_FIRMWARE_RESET;
|
||||
starting_state = FW_INIT_STEP2_DATA;
|
||||
} else {
|
||||
RT_TRACE(COMP_FIRMWARE,
|
||||
"PlatformInitFirmware: undefined firmware state\n");
|
||||
}
|
||||
|
||||
for (i = starting_state; i <= FW_INIT_STEP2_DATA; i++) {
|
||||
|
|
|
@ -117,8 +117,6 @@ static u32 _rtl92e_phy_rf_read(struct net_device *dev,
|
|||
} else
|
||||
NewOffset = Offset;
|
||||
} else {
|
||||
RT_TRACE((COMP_PHY|COMP_ERR),
|
||||
"check RF type here, need to be 8256\n");
|
||||
NewOffset = Offset;
|
||||
}
|
||||
rtl92e_set_bb_reg(dev, pPhyReg->rfHSSIPara2, bLSSIReadAddress,
|
||||
|
@ -173,8 +171,6 @@ static void _rtl92e_phy_rf_write(struct net_device *dev,
|
|||
} else
|
||||
NewOffset = Offset;
|
||||
} else {
|
||||
RT_TRACE((COMP_PHY|COMP_ERR),
|
||||
"check RF type here, need to be 8256\n");
|
||||
NewOffset = Offset;
|
||||
}
|
||||
|
||||
|
@ -204,10 +200,9 @@ void rtl92e_set_rf_reg(struct net_device *dev, enum rf90_radio_path eRFPath,
|
|||
|
||||
if (!rtl92e_is_legal_rf_path(dev, eRFPath))
|
||||
return;
|
||||
if (priv->rtllib->eRFPowerState != eRfOn && !priv->being_init_adapter)
|
||||
if (priv->rtllib->rf_power_state != rf_on && !priv->being_init_adapter)
|
||||
return;
|
||||
|
||||
RT_TRACE(COMP_PHY, "FW RF CTRL is not ready now\n");
|
||||
if (priv->Rf_Mode == RF_OP_By_FW) {
|
||||
if (BitMask != bMask12Bits) {
|
||||
Original_Value = _rtl92e_phy_rf_fw_read(dev, eRFPath,
|
||||
|
@ -242,7 +237,7 @@ u32 rtl92e_get_rf_reg(struct net_device *dev, enum rf90_radio_path eRFPath,
|
|||
|
||||
if (!rtl92e_is_legal_rf_path(dev, eRFPath))
|
||||
return 0;
|
||||
if (priv->rtllib->eRFPowerState != eRfOn && !priv->being_init_adapter)
|
||||
if (priv->rtllib->rf_power_state != rf_on && !priv->being_init_adapter)
|
||||
return 0;
|
||||
mutex_lock(&priv->rf_mutex);
|
||||
if (priv->Rf_Mode == RF_OP_By_FW) {
|
||||
|
@ -312,19 +307,14 @@ void rtl92e_config_mac(struct net_device *dev)
|
|||
struct r8192_priv *priv = rtllib_priv(dev);
|
||||
|
||||
if (priv->bTXPowerDataReadFromEEPORM) {
|
||||
RT_TRACE(COMP_PHY, "Rtl819XMACPHY_Array_PG\n");
|
||||
dwArrayLen = MACPHY_Array_PGLength;
|
||||
pdwArray = Rtl819XMACPHY_Array_PG;
|
||||
|
||||
} else {
|
||||
RT_TRACE(COMP_PHY, "Read rtl819XMACPHY_Array\n");
|
||||
dwArrayLen = MACPHY_ArrayLength;
|
||||
pdwArray = Rtl819XMACPHY_Array;
|
||||
}
|
||||
for (i = 0; i < dwArrayLen; i += 3) {
|
||||
RT_TRACE(COMP_DBG,
|
||||
"The Rtl8190MACPHY_Array[0] is %x Rtl8190MACPHY_Array[1] is %x Rtl8190MACPHY_Array[2] is %x\n",
|
||||
pdwArray[i], pdwArray[i+1], pdwArray[i+2]);
|
||||
if (pdwArray[i] == 0x318)
|
||||
pdwArray[i+2] = 0x00000800;
|
||||
rtl92e_set_bb_reg(dev, pdwArray[i], pdwArray[i+1],
|
||||
|
@ -357,20 +347,12 @@ static void _rtl92e_phy_config_bb(struct net_device *dev, u8 ConfigType)
|
|||
rtl92e_set_bb_reg(dev, Rtl819XPHY_REGArray_Table[i],
|
||||
bMaskDWord,
|
||||
Rtl819XPHY_REGArray_Table[i+1]);
|
||||
RT_TRACE(COMP_DBG,
|
||||
"i: %x, The Rtl819xUsbPHY_REGArray[0] is %x Rtl819xUsbPHY_REGArray[1] is %x\n",
|
||||
i, Rtl819XPHY_REGArray_Table[i],
|
||||
Rtl819XPHY_REGArray_Table[i+1]);
|
||||
}
|
||||
} else if (ConfigType == BaseBand_Config_AGC_TAB) {
|
||||
for (i = 0; i < AGCTAB_ArrayLen; i += 2) {
|
||||
rtl92e_set_bb_reg(dev, Rtl819XAGCTAB_Array_Table[i],
|
||||
bMaskDWord,
|
||||
Rtl819XAGCTAB_Array_Table[i+1]);
|
||||
RT_TRACE(COMP_DBG,
|
||||
"i:%x, The rtl819XAGCTAB_Array[0] is %x rtl819XAGCTAB_Array[1] is %x\n",
|
||||
i, Rtl819XAGCTAB_Array_Table[i],
|
||||
Rtl819XAGCTAB_Array_Table[i+1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -478,8 +460,6 @@ bool rtl92e_check_bb_and_rf(struct net_device *dev, enum hw90_block CheckBlock,
|
|||
WriteAddr[HW90_BLOCK_PHY0] = 0x900;
|
||||
WriteAddr[HW90_BLOCK_PHY1] = 0x800;
|
||||
WriteAddr[HW90_BLOCK_RF] = 0x3;
|
||||
RT_TRACE(COMP_PHY, "=======>%s(), CheckBlock:%d\n", __func__,
|
||||
CheckBlock);
|
||||
|
||||
if (CheckBlock == HW90_BLOCK_MAC) {
|
||||
netdev_warn(dev, "%s(): No checks available for MAC block.\n",
|
||||
|
@ -543,9 +523,6 @@ static bool _rtl92e_bb_config_para_file(struct net_device *dev)
|
|||
(enum hw90_block)eCheckItem,
|
||||
(enum rf90_radio_path)0);
|
||||
if (!rtStatus) {
|
||||
RT_TRACE((COMP_ERR | COMP_PHY),
|
||||
"rtl92e_config_rf():Check PHY%d Fail!!\n",
|
||||
eCheckItem-1);
|
||||
return rtStatus;
|
||||
}
|
||||
}
|
||||
|
@ -602,15 +579,9 @@ void rtl92e_get_tx_power(struct net_device *dev)
|
|||
priv->DefaultInitialGain[1] = rtl92e_readb(dev, rOFDM0_XBAGCCore1);
|
||||
priv->DefaultInitialGain[2] = rtl92e_readb(dev, rOFDM0_XCAGCCore1);
|
||||
priv->DefaultInitialGain[3] = rtl92e_readb(dev, rOFDM0_XDAGCCore1);
|
||||
RT_TRACE(COMP_INIT,
|
||||
"Default initial gain (c50=0x%x, c58=0x%x, c60=0x%x, c68=0x%x)\n",
|
||||
priv->DefaultInitialGain[0], priv->DefaultInitialGain[1],
|
||||
priv->DefaultInitialGain[2], priv->DefaultInitialGain[3]);
|
||||
|
||||
priv->framesync = rtl92e_readb(dev, rOFDM0_RxDetector3);
|
||||
priv->framesyncC34 = rtl92e_readl(dev, rOFDM0_RxDetector2);
|
||||
RT_TRACE(COMP_INIT, "Default framesync (0x%x) = 0x%x\n",
|
||||
rOFDM0_RxDetector3, priv->framesync);
|
||||
priv->SifsTime = rtl92e_readw(dev, SIFS);
|
||||
}
|
||||
|
||||
|
@ -813,9 +784,6 @@ static u8 _rtl92e_phy_switch_channel_step(struct net_device *dev, u8 channel,
|
|||
struct sw_chnl_cmd *CurrentCmd = NULL;
|
||||
u8 eRFPath;
|
||||
|
||||
RT_TRACE(COMP_TRACE, "====>%s()====stage:%d, step:%d, channel:%d\n",
|
||||
__func__, *stage, *step, channel);
|
||||
|
||||
if (!rtllib_legal_channel(priv->rtllib, channel)) {
|
||||
netdev_err(dev, "Invalid channel requested: %d\n", channel);
|
||||
return true;
|
||||
|
@ -976,21 +944,13 @@ static void _rtl92e_phy_switch_channel_work_item(struct net_device *dev)
|
|||
|
||||
struct r8192_priv *priv = rtllib_priv(dev);
|
||||
|
||||
RT_TRACE(COMP_TRACE, "==> SwChnlCallback819xUsbWorkItem()\n");
|
||||
|
||||
RT_TRACE(COMP_TRACE, "=====>--%s(), set chan:%d, priv:%p\n", __func__,
|
||||
priv->chan, priv);
|
||||
|
||||
_rtl92e_phy_switch_channel(dev, priv->chan);
|
||||
|
||||
RT_TRACE(COMP_TRACE, "<== SwChnlCallback819xUsbWorkItem()\n");
|
||||
}
|
||||
|
||||
u8 rtl92e_set_channel(struct net_device *dev, u8 channel)
|
||||
{
|
||||
struct r8192_priv *priv = rtllib_priv(dev);
|
||||
|
||||
RT_TRACE(COMP_PHY, "=====>%s()\n", __func__);
|
||||
if (!priv->up) {
|
||||
netdev_err(dev, "%s(): Driver is not initialized\n", __func__);
|
||||
return false;
|
||||
|
@ -1060,10 +1020,6 @@ static void _rtl92e_cck_tx_power_track_bw_switch_tssi(struct net_device *dev)
|
|||
if (priv->CCKPresentAttentuation < 0)
|
||||
priv->CCKPresentAttentuation = 0;
|
||||
|
||||
RT_TRACE(COMP_POWER_TRACKING,
|
||||
"20M, priv->CCKPresentAttentuation = %d\n",
|
||||
priv->CCKPresentAttentuation);
|
||||
|
||||
if (priv->rtllib->current_network.channel == 14 &&
|
||||
!priv->bcck_in_ch14) {
|
||||
priv->bcck_in_ch14 = true;
|
||||
|
@ -1082,9 +1038,6 @@ static void _rtl92e_cck_tx_power_track_bw_switch_tssi(struct net_device *dev)
|
|||
priv->CCKPresentAttentuation_40Mdefault +
|
||||
priv->CCKPresentAttentuation_difference;
|
||||
|
||||
RT_TRACE(COMP_POWER_TRACKING,
|
||||
"40M, priv->CCKPresentAttentuation = %d\n",
|
||||
priv->CCKPresentAttentuation);
|
||||
if (priv->CCKPresentAttentuation >
|
||||
(CCKTxBBGainTableLength - 1))
|
||||
priv->CCKPresentAttentuation =
|
||||
|
@ -1123,16 +1076,10 @@ static void _rtl92e_cck_tx_power_track_bw_switch_thermal(struct net_device *dev)
|
|||
if (priv->Record_CCK_20Mindex == 0)
|
||||
priv->Record_CCK_20Mindex = 6;
|
||||
priv->CCK_index = priv->Record_CCK_20Mindex;
|
||||
RT_TRACE(COMP_POWER_TRACKING,
|
||||
"20MHz, %s,CCK_index = %d\n", __func__,
|
||||
priv->CCK_index);
|
||||
break;
|
||||
|
||||
case HT_CHANNEL_WIDTH_20_40:
|
||||
priv->CCK_index = priv->Record_CCK_40Mindex;
|
||||
RT_TRACE(COMP_POWER_TRACKING,
|
||||
"40MHz, %s, CCK_index = %d\n", __func__,
|
||||
priv->CCK_index);
|
||||
break;
|
||||
}
|
||||
rtl92e_dm_cck_txpower_adjust(dev, priv->bcck_in_ch14);
|
||||
|
@ -1154,12 +1101,6 @@ static void _rtl92e_set_bw_mode_work_item(struct net_device *dev)
|
|||
struct r8192_priv *priv = rtllib_priv(dev);
|
||||
u8 regBwOpMode;
|
||||
|
||||
RT_TRACE(COMP_SWBW,
|
||||
"==>%s Switch to %s bandwidth\n", __func__,
|
||||
priv->CurrentChannelBW == HT_CHANNEL_WIDTH_20 ?
|
||||
"20MHz" : "40MHz");
|
||||
|
||||
|
||||
if (priv->rf_chip == RF_PSEUDO_11N) {
|
||||
priv->SetBWModeInProgress = false;
|
||||
return;
|
||||
|
@ -1251,11 +1192,9 @@ static void _rtl92e_set_bw_mode_work_item(struct net_device *dev)
|
|||
|
||||
atomic_dec(&(priv->rtllib->atm_swbw));
|
||||
priv->SetBWModeInProgress = false;
|
||||
|
||||
RT_TRACE(COMP_SWBW, "<==SetBWMode819xUsb()");
|
||||
}
|
||||
|
||||
void rtl92e_set_bw_mode(struct net_device *dev, enum ht_channel_width Bandwidth,
|
||||
void rtl92e_set_bw_mode(struct net_device *dev, enum ht_channel_width bandwidth,
|
||||
enum ht_extchnl_offset Offset)
|
||||
{
|
||||
struct r8192_priv *priv = rtllib_priv(dev);
|
||||
|
@ -1267,7 +1206,7 @@ void rtl92e_set_bw_mode(struct net_device *dev, enum ht_channel_width Bandwidth,
|
|||
atomic_inc(&(priv->rtllib->atm_swbw));
|
||||
priv->SetBWModeInProgress = true;
|
||||
|
||||
priv->CurrentChannelBW = Bandwidth;
|
||||
priv->CurrentChannelBW = bandwidth;
|
||||
|
||||
if (Offset == HT_EXTCHNL_OFFSET_LOWER)
|
||||
priv->nCur40MhzPrimeSC = HAL_PRIME_CHNL_OFFSET_UPPER;
|
||||
|
@ -1291,8 +1230,6 @@ void rtl92e_init_gain(struct net_device *dev, u8 Operation)
|
|||
if (priv->up) {
|
||||
switch (Operation) {
|
||||
case IG_Backup:
|
||||
RT_TRACE(COMP_SCAN,
|
||||
"IG_Backup, backup the initial gain.\n");
|
||||
initial_gain = SCAN_RX_INITIAL_GAIN;
|
||||
BitMask = bMaskByte0;
|
||||
if (dm_digtable.dig_algorithm ==
|
||||
|
@ -1314,35 +1251,13 @@ void rtl92e_init_gain(struct net_device *dev, u8 Operation)
|
|||
priv->initgain_backup.cca = (u8)rtl92e_get_bb_reg(dev,
|
||||
rCCK0_CCA, BitMask);
|
||||
|
||||
RT_TRACE(COMP_SCAN,
|
||||
"Scan InitialGainBackup 0xc50 is %x\n",
|
||||
priv->initgain_backup.xaagccore1);
|
||||
RT_TRACE(COMP_SCAN,
|
||||
"Scan InitialGainBackup 0xc58 is %x\n",
|
||||
priv->initgain_backup.xbagccore1);
|
||||
RT_TRACE(COMP_SCAN,
|
||||
"Scan InitialGainBackup 0xc60 is %x\n",
|
||||
priv->initgain_backup.xcagccore1);
|
||||
RT_TRACE(COMP_SCAN,
|
||||
"Scan InitialGainBackup 0xc68 is %x\n",
|
||||
priv->initgain_backup.xdagccore1);
|
||||
RT_TRACE(COMP_SCAN,
|
||||
"Scan InitialGainBackup 0xa0a is %x\n",
|
||||
priv->initgain_backup.cca);
|
||||
|
||||
RT_TRACE(COMP_SCAN, "Write scan initial gain = 0x%x\n",
|
||||
initial_gain);
|
||||
rtl92e_writeb(dev, rOFDM0_XAAGCCore1, initial_gain);
|
||||
rtl92e_writeb(dev, rOFDM0_XBAGCCore1, initial_gain);
|
||||
rtl92e_writeb(dev, rOFDM0_XCAGCCore1, initial_gain);
|
||||
rtl92e_writeb(dev, rOFDM0_XDAGCCore1, initial_gain);
|
||||
RT_TRACE(COMP_SCAN, "Write scan 0xa0a = 0x%x\n",
|
||||
POWER_DETECTION_TH);
|
||||
rtl92e_writeb(dev, 0xa0a, POWER_DETECTION_TH);
|
||||
break;
|
||||
case IG_Restore:
|
||||
RT_TRACE(COMP_SCAN,
|
||||
"IG_Restore, restore the initial gain.\n");
|
||||
BitMask = 0x7f;
|
||||
if (dm_digtable.dig_algorithm ==
|
||||
DIG_ALGO_BY_FALSE_ALARM)
|
||||
|
@ -1360,22 +1275,6 @@ void rtl92e_init_gain(struct net_device *dev, u8 Operation)
|
|||
rtl92e_set_bb_reg(dev, rCCK0_CCA, BitMask,
|
||||
(u32)priv->initgain_backup.cca);
|
||||
|
||||
RT_TRACE(COMP_SCAN,
|
||||
"Scan BBInitialGainRestore 0xc50 is %x\n",
|
||||
priv->initgain_backup.xaagccore1);
|
||||
RT_TRACE(COMP_SCAN,
|
||||
"Scan BBInitialGainRestore 0xc58 is %x\n",
|
||||
priv->initgain_backup.xbagccore1);
|
||||
RT_TRACE(COMP_SCAN,
|
||||
"Scan BBInitialGainRestore 0xc60 is %x\n",
|
||||
priv->initgain_backup.xcagccore1);
|
||||
RT_TRACE(COMP_SCAN,
|
||||
"Scan BBInitialGainRestore 0xc68 is %x\n",
|
||||
priv->initgain_backup.xdagccore1);
|
||||
RT_TRACE(COMP_SCAN,
|
||||
"Scan BBInitialGainRestore 0xa0a is %x\n",
|
||||
priv->initgain_backup.cca);
|
||||
|
||||
rtl92e_set_tx_power(dev,
|
||||
priv->rtllib->current_network.channel);
|
||||
|
||||
|
@ -1383,9 +1282,6 @@ void rtl92e_init_gain(struct net_device *dev, u8 Operation)
|
|||
DIG_ALGO_BY_FALSE_ALARM)
|
||||
rtl92e_set_bb_reg(dev, UFWP, bMaskByte1, 0x1);
|
||||
break;
|
||||
default:
|
||||
RT_TRACE(COMP_SCAN, "Unknown IG Operation.\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1405,7 +1301,7 @@ void rtl92e_set_rf_off(struct net_device *dev)
|
|||
}
|
||||
|
||||
static bool _rtl92e_set_rf_power_state(struct net_device *dev,
|
||||
enum rt_rf_power_state eRFPowerState)
|
||||
enum rt_rf_power_state rf_power_state)
|
||||
{
|
||||
struct r8192_priv *priv = rtllib_priv(dev);
|
||||
struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
|
||||
|
@ -1416,15 +1312,13 @@ static bool _rtl92e_set_rf_power_state(struct net_device *dev,
|
|||
|
||||
if (priv->SetRFPowerStateInProgress)
|
||||
return false;
|
||||
RT_TRACE(COMP_PS, "===========> %s!\n", __func__);
|
||||
priv->SetRFPowerStateInProgress = true;
|
||||
|
||||
switch (priv->rf_chip) {
|
||||
case RF_8256:
|
||||
switch (eRFPowerState) {
|
||||
case eRfOn:
|
||||
RT_TRACE(COMP_PS, "%s eRfOn!\n", __func__);
|
||||
if ((priv->rtllib->eRFPowerState == eRfOff) &&
|
||||
switch (rf_power_state) {
|
||||
case rf_on:
|
||||
if ((priv->rtllib->rf_power_state == rf_off) &&
|
||||
RT_IN_PS_LEVEL(pPSC, RT_RF_OFF_LEVL_HALT_NIC)) {
|
||||
bool rtstatus;
|
||||
u32 InitilizeCount = 3;
|
||||
|
@ -1469,8 +1363,8 @@ static bool _rtl92e_set_rf_power_state(struct net_device *dev,
|
|||
|
||||
break;
|
||||
|
||||
case eRfSleep:
|
||||
if (priv->rtllib->eRFPowerState == eRfOff)
|
||||
case rf_sleep:
|
||||
if (priv->rtllib->rf_power_state == rf_off)
|
||||
break;
|
||||
|
||||
|
||||
|
@ -1481,25 +1375,18 @@ static bool _rtl92e_set_rf_power_state(struct net_device *dev,
|
|||
QueueID++;
|
||||
continue;
|
||||
} else {
|
||||
RT_TRACE((COMP_POWER|COMP_RF),
|
||||
"eRf Off/Sleep: %d times TcbBusyQueue[%d] !=0 before doze!\n",
|
||||
(i+1), QueueID);
|
||||
udelay(10);
|
||||
i++;
|
||||
}
|
||||
|
||||
if (i >= MAX_DOZE_WAITING_TIMES_9x) {
|
||||
RT_TRACE(COMP_POWER, "\n\n\n TimeOut!! %s: eRfOff: %d times TcbBusyQueue[%d] != 0 !!!\n",
|
||||
__func__, MAX_DOZE_WAITING_TIMES_9x, QueueID);
|
||||
break;
|
||||
}
|
||||
}
|
||||
rtl92e_set_rf_off(dev);
|
||||
break;
|
||||
|
||||
case eRfOff:
|
||||
RT_TRACE(COMP_PS, "%s eRfOff/Sleep !\n", __func__);
|
||||
|
||||
case rf_off:
|
||||
for (QueueID = 0, i = 0; QueueID < MAX_TX_QUEUE; ) {
|
||||
ring = &priv->tx_ring[QueueID];
|
||||
|
||||
|
@ -1507,18 +1394,11 @@ static bool _rtl92e_set_rf_power_state(struct net_device *dev,
|
|||
QueueID++;
|
||||
continue;
|
||||
} else {
|
||||
RT_TRACE(COMP_POWER,
|
||||
"eRf Off/Sleep: %d times TcbBusyQueue[%d] !=0 before doze!\n",
|
||||
(i+1), QueueID);
|
||||
udelay(10);
|
||||
i++;
|
||||
}
|
||||
|
||||
if (i >= MAX_DOZE_WAITING_TIMES_9x) {
|
||||
RT_TRACE(COMP_POWER,
|
||||
"\n\n\n SetZebra: RFPowerState8185B(): eRfOff: %d times TcbBusyQueue[%d] != 0 !!!\n",
|
||||
MAX_DOZE_WAITING_TIMES_9x,
|
||||
QueueID);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1538,7 +1418,7 @@ static bool _rtl92e_set_rf_power_state(struct net_device *dev,
|
|||
bResult = false;
|
||||
netdev_warn(dev,
|
||||
"%s(): Unknown state requested: 0x%X.\n",
|
||||
__func__, eRFPowerState);
|
||||
__func__, rf_power_state);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1550,7 +1430,7 @@ static bool _rtl92e_set_rf_power_state(struct net_device *dev,
|
|||
}
|
||||
|
||||
if (bResult) {
|
||||
priv->rtllib->eRFPowerState = eRFPowerState;
|
||||
priv->rtllib->rf_power_state = rf_power_state;
|
||||
|
||||
switch (priv->rf_chip) {
|
||||
case RF_8256:
|
||||
|
@ -1563,30 +1443,22 @@ static bool _rtl92e_set_rf_power_state(struct net_device *dev,
|
|||
}
|
||||
|
||||
priv->SetRFPowerStateInProgress = false;
|
||||
RT_TRACE(COMP_PS, "<=========== %s bResult = %d!\n", __func__, bResult);
|
||||
return bResult;
|
||||
}
|
||||
|
||||
bool rtl92e_set_rf_power_state(struct net_device *dev,
|
||||
enum rt_rf_power_state eRFPowerState)
|
||||
enum rt_rf_power_state rf_power_state)
|
||||
{
|
||||
struct r8192_priv *priv = rtllib_priv(dev);
|
||||
|
||||
bool bResult = false;
|
||||
|
||||
RT_TRACE(COMP_PS,
|
||||
"---------> %s: eRFPowerState(%d)\n", __func__, eRFPowerState);
|
||||
if (eRFPowerState == priv->rtllib->eRFPowerState &&
|
||||
if (rf_power_state == priv->rtllib->rf_power_state &&
|
||||
priv->bHwRfOffAction == 0) {
|
||||
RT_TRACE(COMP_PS, "<--------- %s: discard the request for eRFPowerState(%d) is the same.\n",
|
||||
__func__, eRFPowerState);
|
||||
return bResult;
|
||||
}
|
||||
|
||||
bResult = _rtl92e_set_rf_power_state(dev, eRFPowerState);
|
||||
|
||||
RT_TRACE(COMP_PS, "<--------- %s: bResult(%d)\n", __func__, bResult);
|
||||
|
||||
bResult = _rtl92e_set_rf_power_state(dev, rf_power_state);
|
||||
return bResult;
|
||||
}
|
||||
|
||||
|
@ -1603,10 +1475,6 @@ void rtl92e_scan_op_backup(struct net_device *dev, u8 Operation)
|
|||
case SCAN_OPT_RESTORE:
|
||||
priv->rtllib->InitialGainHandler(dev, IG_Restore);
|
||||
break;
|
||||
|
||||
default:
|
||||
RT_TRACE(COMP_SCAN, "Unknown Scan Backup Operation.\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -75,15 +75,14 @@ u8 rtl92e_config_rf_path(struct net_device *dev, enum rf90_radio_path eRFPath);
|
|||
|
||||
u8 rtl92e_set_channel(struct net_device *dev, u8 channel);
|
||||
void rtl92e_set_bw_mode(struct net_device *dev,
|
||||
enum ht_channel_width Bandwidth,
|
||||
enum ht_channel_width bandwidth,
|
||||
enum ht_extchnl_offset Offset);
|
||||
void rtl92e_init_gain(struct net_device *dev, u8 Operation);
|
||||
|
||||
void rtl92e_set_rf_off(struct net_device *dev);
|
||||
|
||||
bool rtl92e_set_rf_power_state(struct net_device *dev,
|
||||
enum rt_rf_power_state eRFPowerState);
|
||||
#define PHY_SetRFPowerState rtl92e_set_rf_power_state
|
||||
enum rt_rf_power_state rf_power_state);
|
||||
|
||||
void rtl92e_scan_op_backup(struct net_device *dev, u8 Operation);
|
||||
|
||||
|
|
|
@ -42,14 +42,10 @@ void rtl92e_enable_hw_security_config(struct net_device *dev)
|
|||
|
||||
|
||||
ieee->hwsec_active = 1;
|
||||
if ((ieee->pHTInfo->IOTAction&HT_IOT_ACT_PURE_N_MODE) || !hwwep) {
|
||||
if ((ieee->pHTInfo->iot_action & HT_IOT_ACT_PURE_N_MODE) || !hwwep) {
|
||||
ieee->hwsec_active = 0;
|
||||
SECR_value &= ~SCR_RxDecEnable;
|
||||
}
|
||||
|
||||
RT_TRACE(COMP_SEC, "%s:, hwsec:%d, pairwise_key:%d, SECR_value:%x\n",
|
||||
__func__, ieee->hwsec_active, ieee->pairwise_key_type,
|
||||
SECR_value);
|
||||
rtl92e_writeb(dev, SECR, SECR_value);
|
||||
}
|
||||
|
||||
|
@ -60,10 +56,6 @@ void rtl92e_set_swcam(struct net_device *dev, u8 EntryNo, u8 KeyIndex,
|
|||
struct r8192_priv *priv = rtllib_priv(dev);
|
||||
struct rtllib_device *ieee = priv->rtllib;
|
||||
|
||||
RT_TRACE(COMP_DBG,
|
||||
"===========>%s():EntryNo is %d,KeyIndex is %d,KeyType is %d,is_mesh is %d\n",
|
||||
__func__, EntryNo, KeyIndex, KeyType, is_mesh);
|
||||
|
||||
if (EntryNo >= TOTAL_CAM_ENTRY)
|
||||
return;
|
||||
|
||||
|
@ -86,12 +78,12 @@ void rtl92e_set_key(struct net_device *dev, u8 EntryNo, u8 KeyIndex,
|
|||
u16 usConfig = 0;
|
||||
u8 i;
|
||||
struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev);
|
||||
enum rt_rf_power_state rtState;
|
||||
enum rt_rf_power_state rt_state;
|
||||
|
||||
rtState = priv->rtllib->eRFPowerState;
|
||||
rt_state = priv->rtllib->rf_power_state;
|
||||
if (priv->rtllib->PowerSaveControl.bInactivePs) {
|
||||
if (rtState == eRfOff) {
|
||||
if (priv->rtllib->RfOffReason > RF_CHANGE_BY_IPS) {
|
||||
if (rt_state == rf_off) {
|
||||
if (priv->rtllib->rf_off_reason > RF_CHANGE_BY_IPS) {
|
||||
netdev_warn(dev, "%s(): RF is OFF.\n",
|
||||
__func__);
|
||||
return;
|
||||
|
@ -107,10 +99,6 @@ void rtl92e_set_key(struct net_device *dev, u8 EntryNo, u8 KeyIndex,
|
|||
return;
|
||||
}
|
||||
|
||||
RT_TRACE(COMP_SEC,
|
||||
"====>to %s, dev:%p, EntryNo:%d, KeyIndex:%d,KeyType:%d, MacAddr %pM\n",
|
||||
__func__, dev, EntryNo, KeyIndex, KeyType, MacAddr);
|
||||
|
||||
if (DefaultKey)
|
||||
usConfig |= BIT15 | (KeyType<<2);
|
||||
else
|
||||
|
@ -144,7 +132,6 @@ void rtl92e_set_key(struct net_device *dev, u8 EntryNo, u8 KeyIndex,
|
|||
}
|
||||
}
|
||||
}
|
||||
RT_TRACE(COMP_SEC, "=========>after set key, usconfig:%x\n", usConfig);
|
||||
}
|
||||
|
||||
void rtl92e_cam_restore(struct net_device *dev)
|
||||
|
@ -163,9 +150,6 @@ void rtl92e_cam_restore(struct net_device *dev)
|
|||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff
|
||||
};
|
||||
|
||||
RT_TRACE(COMP_SEC, "%s:\n", __func__);
|
||||
|
||||
|
||||
if ((priv->rtllib->pairwise_key_type == KEY_TYPE_WEP40) ||
|
||||
(priv->rtllib->pairwise_key_type == KEY_TYPE_WEP104)) {
|
||||
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
int hwwep = 1;
|
||||
static char *ifname = "wlan%d";
|
||||
|
||||
|
||||
static const struct rtl819x_ops rtl819xp_ops = {
|
||||
.nic_type = NIC_8192E,
|
||||
.get_eeprom_size = rtl92e_get_eeprom_size,
|
||||
|
@ -44,8 +43,8 @@ static const struct rtl819x_ops rtl819xp_ops = {
|
|||
.rx_enable = rtl92e_enable_rx,
|
||||
.tx_enable = rtl92e_enable_tx,
|
||||
.interrupt_recognized = rtl92e_ack_irq,
|
||||
.TxCheckStuckHandler = rtl92e_is_tx_stuck,
|
||||
.RxCheckStuckHandler = rtl92e_is_rx_stuck,
|
||||
.tx_check_stuck_handler = rtl92e_is_tx_stuck,
|
||||
.rx_check_stuck_handler = rtl92e_is_rx_stuck,
|
||||
};
|
||||
|
||||
static struct pci_device_id rtl8192_pci_id_tbl[] = {
|
||||
|
@ -133,36 +132,27 @@ void rtl92e_writew(struct net_device *dev, int x, u16 y)
|
|||
* -----------------------------GENERAL FUNCTION-------------------------
|
||||
****************************************************************************/
|
||||
bool rtl92e_set_rf_state(struct net_device *dev,
|
||||
enum rt_rf_power_state StateToSet,
|
||||
RT_RF_CHANGE_SOURCE ChangeSource)
|
||||
enum rt_rf_power_state state_to_set,
|
||||
RT_RF_CHANGE_SOURCE change_source)
|
||||
{
|
||||
struct r8192_priv *priv = rtllib_priv(dev);
|
||||
struct rtllib_device *ieee = priv->rtllib;
|
||||
bool bActionAllowed = false;
|
||||
bool bConnectBySSID = false;
|
||||
enum rt_rf_power_state rtState;
|
||||
u16 RFWaitCounter = 0;
|
||||
bool action_allowed = false;
|
||||
bool connect_by_ssid = false;
|
||||
enum rt_rf_power_state rt_state;
|
||||
u16 rf_wait_counter = 0;
|
||||
unsigned long flag;
|
||||
|
||||
RT_TRACE((COMP_PS | COMP_RF),
|
||||
"===>%s: StateToSet(%d)\n", __func__, StateToSet);
|
||||
|
||||
while (true) {
|
||||
spin_lock_irqsave(&priv->rf_ps_lock, flag);
|
||||
if (priv->RFChangeInProgress) {
|
||||
if (priv->rf_change_in_progress) {
|
||||
spin_unlock_irqrestore(&priv->rf_ps_lock, flag);
|
||||
RT_TRACE((COMP_PS | COMP_RF),
|
||||
"%s: RF Change in progress! Wait to set..StateToSet(%d).\n",
|
||||
__func__, StateToSet);
|
||||
|
||||
while (priv->RFChangeInProgress) {
|
||||
RFWaitCounter++;
|
||||
RT_TRACE((COMP_PS | COMP_RF),
|
||||
"%s: Wait 1 ms (%d times)...\n",
|
||||
__func__, RFWaitCounter);
|
||||
while (priv->rf_change_in_progress) {
|
||||
rf_wait_counter++;
|
||||
mdelay(1);
|
||||
|
||||
if (RFWaitCounter > 100) {
|
||||
if (rf_wait_counter > 100) {
|
||||
netdev_warn(dev,
|
||||
"%s(): Timeout waiting for RF change.\n",
|
||||
__func__);
|
||||
|
@ -170,43 +160,37 @@ bool rtl92e_set_rf_state(struct net_device *dev,
|
|||
}
|
||||
}
|
||||
} else {
|
||||
priv->RFChangeInProgress = true;
|
||||
priv->rf_change_in_progress = true;
|
||||
spin_unlock_irqrestore(&priv->rf_ps_lock, flag);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
rtState = priv->rtllib->eRFPowerState;
|
||||
rt_state = priv->rtllib->rf_power_state;
|
||||
|
||||
switch (StateToSet) {
|
||||
case eRfOn:
|
||||
priv->rtllib->RfOffReason &= (~ChangeSource);
|
||||
switch (state_to_set) {
|
||||
case rf_on:
|
||||
priv->rtllib->rf_off_reason &= (~change_source);
|
||||
|
||||
if ((ChangeSource == RF_CHANGE_BY_HW) && priv->bHwRadioOff)
|
||||
priv->bHwRadioOff = false;
|
||||
if ((change_source == RF_CHANGE_BY_HW) && priv->hw_radio_off)
|
||||
priv->hw_radio_off = false;
|
||||
|
||||
if (!priv->rtllib->RfOffReason) {
|
||||
priv->rtllib->RfOffReason = 0;
|
||||
bActionAllowed = true;
|
||||
|
||||
|
||||
if (rtState == eRfOff &&
|
||||
ChangeSource >= RF_CHANGE_BY_HW)
|
||||
bConnectBySSID = true;
|
||||
} else {
|
||||
RT_TRACE((COMP_PS | COMP_RF),
|
||||
"%s - eRfon reject pMgntInfo->RfOffReason= 0x%x, ChangeSource=0x%X\n",
|
||||
__func__, priv->rtllib->RfOffReason, ChangeSource);
|
||||
}
|
||||
if (!priv->rtllib->rf_off_reason) {
|
||||
priv->rtllib->rf_off_reason = 0;
|
||||
action_allowed = true;
|
||||
|
||||
if (rt_state == rf_off &&
|
||||
change_source >= RF_CHANGE_BY_HW)
|
||||
connect_by_ssid = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case eRfOff:
|
||||
case rf_off:
|
||||
|
||||
if ((priv->rtllib->iw_mode == IW_MODE_INFRA) ||
|
||||
(priv->rtllib->iw_mode == IW_MODE_ADHOC)) {
|
||||
if ((priv->rtllib->RfOffReason > RF_CHANGE_BY_IPS) ||
|
||||
(ChangeSource > RF_CHANGE_BY_IPS)) {
|
||||
if ((priv->rtllib->rf_off_reason > RF_CHANGE_BY_IPS) ||
|
||||
(change_source > RF_CHANGE_BY_IPS)) {
|
||||
if (ieee->state == RTLLIB_LINKED)
|
||||
priv->blinked_ingpio = true;
|
||||
else
|
||||
|
@ -215,46 +199,36 @@ bool rtl92e_set_rf_state(struct net_device *dev,
|
|||
WLAN_REASON_DISASSOC_STA_HAS_LEFT);
|
||||
}
|
||||
}
|
||||
if ((ChangeSource == RF_CHANGE_BY_HW) && !priv->bHwRadioOff)
|
||||
priv->bHwRadioOff = true;
|
||||
priv->rtllib->RfOffReason |= ChangeSource;
|
||||
bActionAllowed = true;
|
||||
if ((change_source == RF_CHANGE_BY_HW) && !priv->hw_radio_off)
|
||||
priv->hw_radio_off = true;
|
||||
priv->rtllib->rf_off_reason |= change_source;
|
||||
action_allowed = true;
|
||||
break;
|
||||
|
||||
case eRfSleep:
|
||||
priv->rtllib->RfOffReason |= ChangeSource;
|
||||
bActionAllowed = true;
|
||||
case rf_sleep:
|
||||
priv->rtllib->rf_off_reason |= change_source;
|
||||
action_allowed = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (bActionAllowed) {
|
||||
RT_TRACE((COMP_PS | COMP_RF),
|
||||
"%s: Action is allowed.... StateToSet(%d), RfOffReason(%#X)\n",
|
||||
__func__, StateToSet, priv->rtllib->RfOffReason);
|
||||
PHY_SetRFPowerState(dev, StateToSet);
|
||||
if (StateToSet == eRfOn) {
|
||||
|
||||
if (bConnectBySSID && priv->blinked_ingpio) {
|
||||
if (action_allowed) {
|
||||
rtl92e_set_rf_power_state(dev, state_to_set);
|
||||
if (state_to_set == rf_on) {
|
||||
if (connect_by_ssid && priv->blinked_ingpio) {
|
||||
schedule_delayed_work(
|
||||
&ieee->associate_procedure_wq, 0);
|
||||
priv->blinked_ingpio = false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
RT_TRACE((COMP_PS | COMP_RF),
|
||||
"%s: Action is rejected.... StateToSet(%d), ChangeSource(%#X), RfOffReason(%#X)\n",
|
||||
__func__, StateToSet, ChangeSource, priv->rtllib->RfOffReason);
|
||||
}
|
||||
|
||||
spin_lock_irqsave(&priv->rf_ps_lock, flag);
|
||||
priv->RFChangeInProgress = false;
|
||||
priv->rf_change_in_progress = false;
|
||||
spin_unlock_irqrestore(&priv->rf_ps_lock, flag);
|
||||
|
||||
RT_TRACE((COMP_PS | COMP_RF), "<===%s\n", __func__);
|
||||
return bActionAllowed;
|
||||
return action_allowed;
|
||||
}
|
||||
|
||||
static short _rtl92e_check_nic_enough_desc(struct net_device *dev, int prio)
|
||||
|
@ -297,7 +271,6 @@ static void _rtl92e_set_chan(struct net_device *dev, short ch)
|
|||
{
|
||||
struct r8192_priv *priv = rtllib_priv(dev);
|
||||
|
||||
RT_TRACE(COMP_CH, "=====>%s()====ch:%d\n", __func__, ch);
|
||||
if (priv->chan_forced)
|
||||
return;
|
||||
|
||||
|
@ -314,22 +287,16 @@ static void _rtl92e_update_cap(struct net_device *dev, u16 cap)
|
|||
bool ShortPreamble;
|
||||
|
||||
if (cap & WLAN_CAPABILITY_SHORT_PREAMBLE) {
|
||||
if (priv->dot11CurrentPreambleMode != PREAMBLE_SHORT) {
|
||||
if (priv->dot11_current_preamble_mode != PREAMBLE_SHORT) {
|
||||
ShortPreamble = true;
|
||||
priv->dot11CurrentPreambleMode = PREAMBLE_SHORT;
|
||||
RT_TRACE(COMP_DBG,
|
||||
"%s(): WLAN_CAPABILITY_SHORT_PREAMBLE\n",
|
||||
__func__);
|
||||
priv->dot11_current_preamble_mode = PREAMBLE_SHORT;
|
||||
priv->rtllib->SetHwRegHandler(dev, HW_VAR_ACK_PREAMBLE,
|
||||
(unsigned char *)&ShortPreamble);
|
||||
}
|
||||
} else {
|
||||
if (priv->dot11CurrentPreambleMode != PREAMBLE_LONG) {
|
||||
if (priv->dot11_current_preamble_mode != PREAMBLE_LONG) {
|
||||
ShortPreamble = false;
|
||||
priv->dot11CurrentPreambleMode = PREAMBLE_LONG;
|
||||
RT_TRACE(COMP_DBG,
|
||||
"%s(): WLAN_CAPABILITY_LONG_PREAMBLE\n",
|
||||
__func__);
|
||||
priv->dot11_current_preamble_mode = PREAMBLE_LONG;
|
||||
priv->rtllib->SetHwRegHandler(dev, HW_VAR_ACK_PREAMBLE,
|
||||
(unsigned char *)&ShortPreamble);
|
||||
}
|
||||
|
@ -337,17 +304,17 @@ static void _rtl92e_update_cap(struct net_device *dev, u16 cap)
|
|||
|
||||
if (net->mode & (IEEE_G | IEEE_N_24G)) {
|
||||
u8 slot_time_val;
|
||||
u8 CurSlotTime = priv->slot_time;
|
||||
u8 cur_slot_time = priv->slot_time;
|
||||
|
||||
if ((cap & WLAN_CAPABILITY_SHORT_SLOT_TIME) &&
|
||||
(!priv->rtllib->pHTInfo->bCurrentRT2RTLongSlotTime)) {
|
||||
if (CurSlotTime != SHORT_SLOT_TIME) {
|
||||
(!priv->rtllib->pHTInfo->current_rt2rt_long_slot_time)) {
|
||||
if (cur_slot_time != SHORT_SLOT_TIME) {
|
||||
slot_time_val = SHORT_SLOT_TIME;
|
||||
priv->rtllib->SetHwRegHandler(dev,
|
||||
HW_VAR_SLOT_TIME, &slot_time_val);
|
||||
}
|
||||
} else {
|
||||
if (CurSlotTime != NON_SHORT_SLOT_TIME) {
|
||||
if (cur_slot_time != NON_SHORT_SLOT_TIME) {
|
||||
slot_time_val = NON_SHORT_SLOT_TIME;
|
||||
priv->rtllib->SetHwRegHandler(dev,
|
||||
HW_VAR_SLOT_TIME, &slot_time_val);
|
||||
|
@ -374,7 +341,7 @@ static void _rtl92e_update_beacon(void *data)
|
|||
|
||||
if (ieee->pHTInfo->bCurrentHTSupport)
|
||||
HT_update_self_and_peer_setting(ieee, net);
|
||||
ieee->pHTInfo->bCurrentRT2RTLongSlotTime = net->bssht.bd_rt2rt_long_slot_time;
|
||||
ieee->pHTInfo->current_rt2rt_long_slot_time = net->bssht.bd_rt2rt_long_slot_time;
|
||||
ieee->pHTInfo->RT2RT_HT_Mode = net->bssht.rt2rt_ht_mode;
|
||||
_rtl92e_update_cap(dev, net->capability);
|
||||
}
|
||||
|
@ -389,13 +356,10 @@ static void _rtl92e_qos_activate(void *data)
|
|||
mutex_lock(&priv->mutex);
|
||||
if (priv->rtllib->state != RTLLIB_LINKED)
|
||||
goto success;
|
||||
RT_TRACE(COMP_QOS,
|
||||
"qos active process with associate response received\n");
|
||||
|
||||
for (i = 0; i < QOS_QUEUE_NUM; i++)
|
||||
priv->rtllib->SetHwRegHandler(dev, HW_VAR_AC_PARAM, (u8 *)(&i));
|
||||
|
||||
|
||||
success:
|
||||
mutex_unlock(&priv->mutex);
|
||||
}
|
||||
|
@ -426,18 +390,14 @@ static int _rtl92e_qos_handle_probe_response(struct r8192_priv *priv,
|
|||
network->qos_data.param_count;
|
||||
priv->rtllib->wmm_acm = network->qos_data.wmm_acm;
|
||||
schedule_work(&priv->qos_activate);
|
||||
RT_TRACE(COMP_QOS,
|
||||
"QoS parameters change call qos_activate\n");
|
||||
}
|
||||
} else {
|
||||
memcpy(&priv->rtllib->current_network.qos_data.parameters,
|
||||
&def_qos_parameters, size);
|
||||
|
||||
if ((network->qos_data.active == 1) && (active_network == 1)) {
|
||||
if ((network->qos_data.active == 1) && (active_network == 1))
|
||||
schedule_work(&priv->qos_activate);
|
||||
RT_TRACE(COMP_QOS,
|
||||
"QoS was disabled call qos_activate\n");
|
||||
}
|
||||
|
||||
network->qos_data.active = 0;
|
||||
network->qos_data.supported = 0;
|
||||
}
|
||||
|
@ -455,7 +415,6 @@ static int _rtl92e_handle_beacon(struct net_device *dev,
|
|||
|
||||
schedule_delayed_work(&priv->update_beacon_wq, 0);
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
static int _rtl92e_qos_assoc_resp(struct r8192_priv *priv,
|
||||
|
@ -496,8 +455,6 @@ static int _rtl92e_qos_assoc_resp(struct r8192_priv *priv,
|
|||
|
||||
spin_unlock_irqrestore(&priv->rtllib->lock, flags);
|
||||
|
||||
RT_TRACE(COMP_QOS, "%s: network->flags = %d,%d\n", __func__,
|
||||
network->flags, priv->rtllib->current_network.qos_data.active);
|
||||
if (set_qos_param == 1) {
|
||||
rtl92e_dm_init_edca_turbo(priv->rtllib->dev);
|
||||
schedule_work(&priv->qos_activate);
|
||||
|
@ -716,15 +673,9 @@ void rtl92e_set_wireless_mode(struct net_device *dev, u8 wireless_mode)
|
|||
if ((wireless_mode == WIRELESS_MODE_N_24G) ||
|
||||
(wireless_mode == WIRELESS_MODE_N_5G)) {
|
||||
priv->rtllib->pHTInfo->bEnableHT = 1;
|
||||
RT_TRACE(COMP_DBG, "%s(), wireless_mode:%x, bEnableHT = 1\n",
|
||||
__func__, wireless_mode);
|
||||
} else {
|
||||
priv->rtllib->pHTInfo->bEnableHT = 0;
|
||||
RT_TRACE(COMP_DBG, "%s(), wireless_mode:%x, bEnableHT = 0\n",
|
||||
__func__, wireless_mode);
|
||||
}
|
||||
|
||||
RT_TRACE(COMP_INIT, "Current Wireless Mode is %x\n", wireless_mode);
|
||||
_rtl92e_refresh_support_rate(priv);
|
||||
}
|
||||
|
||||
|
@ -742,7 +693,6 @@ static int _rtl92e_sta_up(struct net_device *dev, bool is_silent_reset)
|
|||
priv->rtllib->ieee_up = 1;
|
||||
|
||||
priv->up_first_time = 0;
|
||||
RT_TRACE(COMP_INIT, "Bringing up iface");
|
||||
priv->bfirst_init = true;
|
||||
init_status = priv->ops->initialize_adapter(dev);
|
||||
if (!init_status) {
|
||||
|
@ -751,7 +701,6 @@ static int _rtl92e_sta_up(struct net_device *dev, bool is_silent_reset)
|
|||
return -1;
|
||||
}
|
||||
|
||||
RT_TRACE(COMP_INIT, "start adapter finished\n");
|
||||
RT_CLEAR_PS_LEVEL(pPSC, RT_RF_OFF_LEVL_HALT_NIC);
|
||||
priv->bfirst_init = false;
|
||||
|
||||
|
@ -790,7 +739,6 @@ static int _rtl92e_sta_down(struct net_device *dev, bool shutdownrf)
|
|||
priv->up = 0;
|
||||
priv->rtllib->ieee_up = 0;
|
||||
priv->bfirst_after_down = true;
|
||||
RT_TRACE(COMP_DOWN, "==========>%s()\n", __func__);
|
||||
if (!netif_queue_stopped(dev))
|
||||
netif_stop_queue(dev);
|
||||
|
||||
|
@ -807,29 +755,25 @@ static int _rtl92e_sta_down(struct net_device *dev, bool shutdownrf)
|
|||
|
||||
rtllib_softmac_stop_protocol(priv->rtllib, 0, true);
|
||||
spin_lock_irqsave(&priv->rf_ps_lock, flags);
|
||||
while (priv->RFChangeInProgress) {
|
||||
while (priv->rf_change_in_progress) {
|
||||
spin_unlock_irqrestore(&priv->rf_ps_lock, flags);
|
||||
if (RFInProgressTimeOut > 100) {
|
||||
spin_lock_irqsave(&priv->rf_ps_lock, flags);
|
||||
break;
|
||||
}
|
||||
RT_TRACE(COMP_DBG,
|
||||
"===>%s():RF is in progress, need to wait until rf change is done.\n",
|
||||
__func__);
|
||||
mdelay(1);
|
||||
RFInProgressTimeOut++;
|
||||
spin_lock_irqsave(&priv->rf_ps_lock, flags);
|
||||
}
|
||||
priv->RFChangeInProgress = true;
|
||||
priv->rf_change_in_progress = true;
|
||||
spin_unlock_irqrestore(&priv->rf_ps_lock, flags);
|
||||
priv->ops->stop_adapter(dev, false);
|
||||
spin_lock_irqsave(&priv->rf_ps_lock, flags);
|
||||
priv->RFChangeInProgress = false;
|
||||
priv->rf_change_in_progress = false;
|
||||
spin_unlock_irqrestore(&priv->rf_ps_lock, flags);
|
||||
udelay(100);
|
||||
memset(&priv->rtllib->current_network, 0,
|
||||
offsetof(struct rtllib_network, list));
|
||||
RT_TRACE(COMP_DOWN, "<==========%s()\n", __func__);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -883,14 +827,13 @@ static void _rtl92e_init_priv_constant(struct net_device *dev)
|
|||
pPSC->RegMaxLPSAwakeIntvl = 5;
|
||||
}
|
||||
|
||||
|
||||
static void _rtl92e_init_priv_variable(struct net_device *dev)
|
||||
{
|
||||
struct r8192_priv *priv = rtllib_priv(dev);
|
||||
u8 i;
|
||||
|
||||
priv->AcmMethod = eAcmWay2_SW;
|
||||
priv->dot11CurrentPreambleMode = PREAMBLE_AUTO;
|
||||
priv->dot11_current_preamble_mode = PREAMBLE_AUTO;
|
||||
priv->rtllib->status = 0;
|
||||
priv->polling_timer_on = 0;
|
||||
priv->up_first_time = 1;
|
||||
|
@ -935,12 +878,12 @@ static void _rtl92e_init_priv_variable(struct net_device *dev)
|
|||
memset(&priv->InterruptLog, 0, sizeof(struct log_int_8190));
|
||||
priv->RxCounter = 0;
|
||||
priv->rtllib->wx_set_enc = 0;
|
||||
priv->bHwRadioOff = false;
|
||||
priv->hw_radio_off = false;
|
||||
priv->RegRfOff = false;
|
||||
priv->isRFOff = false;
|
||||
priv->bInPowerSaveMode = false;
|
||||
priv->rtllib->RfOffReason = 0;
|
||||
priv->RFChangeInProgress = false;
|
||||
priv->rtllib->rf_off_reason = 0;
|
||||
priv->rf_change_in_progress = false;
|
||||
priv->bHwRfOffAction = 0;
|
||||
priv->SetRFPowerStateInProgress = false;
|
||||
priv->rtllib->PowerSaveControl.bInactivePs = true;
|
||||
|
@ -949,7 +892,7 @@ static void _rtl92e_init_priv_variable(struct net_device *dev)
|
|||
priv->rtllib->PowerSaveControl.bFwCtrlLPS = false;
|
||||
priv->rtllib->LPSDelayCnt = 0;
|
||||
priv->rtllib->sta_sleep = LPS_IS_WAKE;
|
||||
priv->rtllib->eRFPowerState = eRfOn;
|
||||
priv->rtllib->rf_power_state = rf_on;
|
||||
|
||||
priv->rtllib->current_network.beacon_interval = DEFAULT_BEACONINTERVAL;
|
||||
priv->rtllib->iw_mode = IW_MODE_INFRA;
|
||||
|
@ -1032,7 +975,6 @@ static short _rtl92e_get_channel_map(struct net_device *dev)
|
|||
"rtl819x_init:Error channel plan! Set to default.\n");
|
||||
priv->ChannelPlan = COUNTRY_CODE_FCC;
|
||||
}
|
||||
RT_TRACE(COMP_INIT, "Channel plan is %d\n", priv->ChannelPlan);
|
||||
dot11d_init(priv->rtllib);
|
||||
dot11d_channel_map(priv->ChannelPlan, priv->rtllib);
|
||||
for (i = 1; i <= 11; i++)
|
||||
|
@ -1072,7 +1014,6 @@ static short _rtl92e_init(struct net_device *dev)
|
|||
}
|
||||
|
||||
priv->irq = dev->irq;
|
||||
RT_TRACE(COMP_INIT, "IRQ %d\n", dev->irq);
|
||||
|
||||
if (_rtl92e_pci_initdescring(dev) != 0) {
|
||||
netdev_err(dev, "Endopoints initialization failed");
|
||||
|
@ -1149,11 +1090,8 @@ static enum reset_type _rtl92e_tx_check_stuck(struct net_device *dev)
|
|||
spin_unlock_irqrestore(&priv->irq_th_lock, flags);
|
||||
|
||||
if (bCheckFwTxCnt) {
|
||||
if (priv->ops->TxCheckStuckHandler(dev)) {
|
||||
RT_TRACE(COMP_RESET,
|
||||
"TxCheckStuck(): Fw indicates no Tx condition!\n");
|
||||
if (priv->ops->tx_check_stuck_handler(dev))
|
||||
return RESET_TYPE_SILENT;
|
||||
}
|
||||
}
|
||||
|
||||
return RESET_TYPE_NORESET;
|
||||
|
@ -1163,10 +1101,8 @@ static enum reset_type _rtl92e_rx_check_stuck(struct net_device *dev)
|
|||
{
|
||||
struct r8192_priv *priv = rtllib_priv(dev);
|
||||
|
||||
if (priv->ops->RxCheckStuckHandler(dev)) {
|
||||
RT_TRACE(COMP_RESET, "RxStuck Condition\n");
|
||||
if (priv->ops->rx_check_stuck_handler(dev))
|
||||
return RESET_TYPE_SILENT;
|
||||
}
|
||||
|
||||
return RESET_TYPE_NORESET;
|
||||
}
|
||||
|
@ -1178,12 +1114,12 @@ static enum reset_type _rtl92e_if_check_reset(struct net_device *dev)
|
|||
enum reset_type RxResetType = RESET_TYPE_NORESET;
|
||||
enum rt_rf_power_state rfState;
|
||||
|
||||
rfState = priv->rtllib->eRFPowerState;
|
||||
rfState = priv->rtllib->rf_power_state;
|
||||
|
||||
if (rfState == eRfOn)
|
||||
if (rfState == rf_on)
|
||||
TxResetType = _rtl92e_tx_check_stuck(dev);
|
||||
|
||||
if (rfState == eRfOn &&
|
||||
if (rfState == rf_on &&
|
||||
(priv->rtllib->iw_mode == IW_MODE_INFRA) &&
|
||||
(priv->rtllib->state == RTLLIB_LINKED))
|
||||
RxResetType = _rtl92e_rx_check_stuck(dev);
|
||||
|
@ -1201,7 +1137,6 @@ static enum reset_type _rtl92e_if_check_reset(struct net_device *dev)
|
|||
} else {
|
||||
return RESET_TYPE_NORESET;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static void _rtl92e_if_silent_reset(struct net_device *dev)
|
||||
|
@ -1213,17 +1148,14 @@ static void _rtl92e_if_silent_reset(struct net_device *dev)
|
|||
unsigned long flag;
|
||||
|
||||
if (priv->ResetProgress == RESET_TYPE_NORESET) {
|
||||
|
||||
RT_TRACE(COMP_RESET, "=========>Reset progress!!\n");
|
||||
|
||||
priv->ResetProgress = RESET_TYPE_SILENT;
|
||||
|
||||
spin_lock_irqsave(&priv->rf_ps_lock, flag);
|
||||
if (priv->RFChangeInProgress) {
|
||||
if (priv->rf_change_in_progress) {
|
||||
spin_unlock_irqrestore(&priv->rf_ps_lock, flag);
|
||||
goto END;
|
||||
}
|
||||
priv->RFChangeInProgress = true;
|
||||
priv->rf_change_in_progress = true;
|
||||
priv->bResetInProgress = true;
|
||||
spin_unlock_irqrestore(&priv->rf_ps_lock, flag);
|
||||
|
||||
|
@ -1242,12 +1174,7 @@ RESET_START:
|
|||
}
|
||||
priv->up = 0;
|
||||
|
||||
RT_TRACE(COMP_RESET, "%s():======>start to down the driver\n",
|
||||
__func__);
|
||||
mdelay(1000);
|
||||
RT_TRACE(COMP_RESET,
|
||||
"%s():111111111111111111111111======>start to down the driver\n",
|
||||
__func__);
|
||||
|
||||
if (!netif_queue_stopped(dev))
|
||||
netif_stop_queue(dev);
|
||||
|
@ -1275,16 +1202,8 @@ RESET_START:
|
|||
rtl92e_dm_backup_state(dev);
|
||||
|
||||
mutex_unlock(&priv->wx_mutex);
|
||||
RT_TRACE(COMP_RESET,
|
||||
"%s():<==========down process is finished\n",
|
||||
__func__);
|
||||
|
||||
RT_TRACE(COMP_RESET, "%s():<===========up process start\n",
|
||||
__func__);
|
||||
reset_status = _rtl92e_up(dev, true);
|
||||
|
||||
RT_TRACE(COMP_RESET,
|
||||
"%s():<===========up process is finished\n", __func__);
|
||||
if (reset_status == -1) {
|
||||
if (reset_times < 3) {
|
||||
reset_times++;
|
||||
|
@ -1298,7 +1217,7 @@ RESET_START:
|
|||
ieee->is_silent_reset = 1;
|
||||
|
||||
spin_lock_irqsave(&priv->rf_ps_lock, flag);
|
||||
priv->RFChangeInProgress = false;
|
||||
priv->rf_change_in_progress = false;
|
||||
spin_unlock_irqrestore(&priv->rf_ps_lock, flag);
|
||||
|
||||
rtl92e_enable_hw_security_config(dev);
|
||||
|
@ -1333,8 +1252,6 @@ END:
|
|||
priv->bResetInProgress = false;
|
||||
|
||||
rtl92e_writeb(dev, UFWP, 1);
|
||||
RT_TRACE(COMP_RESET, "Reset finished!! ====>[%d]\n",
|
||||
priv->reset_count);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1375,7 +1292,7 @@ static void _rtl92e_watchdog_wq_cb(void *data)
|
|||
bool bHigherBusyRxTraffic = false;
|
||||
bool bEnterPS = false;
|
||||
|
||||
if (!priv->up || priv->bHwRadioOff)
|
||||
if (!priv->up || priv->hw_radio_off)
|
||||
return;
|
||||
|
||||
if (priv->rtllib->state >= RTLLIB_LINKED) {
|
||||
|
@ -1390,13 +1307,11 @@ static void _rtl92e_watchdog_wq_cb(void *data)
|
|||
if (!rtllib_act_scanning(priv->rtllib, false)) {
|
||||
if ((ieee->iw_mode == IW_MODE_INFRA) && (ieee->state ==
|
||||
RTLLIB_NOLINK) &&
|
||||
(ieee->eRFPowerState == eRfOn) && !ieee->is_set_key &&
|
||||
(ieee->rf_power_state == rf_on) && !ieee->is_set_key &&
|
||||
(!ieee->proto_stoppping) && !ieee->wx_set_enc) {
|
||||
if ((ieee->PowerSaveControl.ReturnPoint ==
|
||||
IPS_CALLBACK_NONE) &&
|
||||
(!ieee->bNetPromiscuousMode)) {
|
||||
RT_TRACE(COMP_PS,
|
||||
"====================>haha: rtl92e_ips_enter()\n");
|
||||
rtl92e_ips_enter(dev);
|
||||
}
|
||||
}
|
||||
|
@ -1407,7 +1322,6 @@ static void _rtl92e_watchdog_wq_cb(void *data)
|
|||
ieee->LinkDetectInfo.NumTxOkInPeriod > 100)
|
||||
bBusyTraffic = true;
|
||||
|
||||
|
||||
if (ieee->LinkDetectInfo.NumRxOkInPeriod > 4000 ||
|
||||
ieee->LinkDetectInfo.NumTxOkInPeriod > 4000) {
|
||||
bHigherBusyTraffic = true;
|
||||
|
@ -1433,7 +1347,6 @@ static void _rtl92e_watchdog_wq_cb(void *data)
|
|||
rtl92e_leisure_ps_leave(dev);
|
||||
|
||||
} else {
|
||||
RT_TRACE(COMP_LPS, "====>no link LPS leave\n");
|
||||
rtl92e_leisure_ps_leave(dev);
|
||||
}
|
||||
|
||||
|
@ -1456,9 +1369,8 @@ static void _rtl92e_watchdog_wq_cb(void *data)
|
|||
else
|
||||
priv->check_roaming_cnt = 0;
|
||||
|
||||
|
||||
if (priv->check_roaming_cnt > 0) {
|
||||
if (ieee->eRFPowerState == eRfOff)
|
||||
if (ieee->rf_power_state == rf_off)
|
||||
netdev_info(dev, "%s(): RF is off\n", __func__);
|
||||
|
||||
netdev_info(dev,
|
||||
|
@ -1487,12 +1399,11 @@ static void _rtl92e_watchdog_wq_cb(void *data)
|
|||
}
|
||||
ieee->LinkDetectInfo.NumRecvBcnInPeriod = 0;
|
||||
ieee->LinkDetectInfo.NumRecvDataInPeriod = 0;
|
||||
|
||||
}
|
||||
|
||||
spin_lock_irqsave(&priv->tx_lock, flags);
|
||||
if ((check_reset_cnt++ >= 3) && (!ieee->is_roaming) &&
|
||||
(!priv->RFChangeInProgress) && (!pPSC->bSwRfProcessing)) {
|
||||
(!priv->rf_change_in_progress) && (!pPSC->bSwRfProcessing)) {
|
||||
ResetType = _rtl92e_if_check_reset(dev);
|
||||
check_reset_cnt = 3;
|
||||
}
|
||||
|
@ -1500,7 +1411,6 @@ static void _rtl92e_watchdog_wq_cb(void *data)
|
|||
|
||||
if (!priv->bDisableNormalResetCheck && ResetType == RESET_TYPE_NORMAL) {
|
||||
priv->ResetProgress = RESET_TYPE_NORMAL;
|
||||
RT_TRACE(COMP_RESET, "%s(): NOMAL RESET\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1510,7 +1420,6 @@ static void _rtl92e_watchdog_wq_cb(void *data)
|
|||
priv->force_reset = false;
|
||||
priv->bForcedSilentReset = false;
|
||||
priv->bResetInProgress = false;
|
||||
RT_TRACE(COMP_TRACE, " <==RtUsbCheckForHangWorkItemCallback()\n");
|
||||
}
|
||||
|
||||
static void _rtl92e_watchdog_timer_cb(struct timer_list *t)
|
||||
|
@ -1541,7 +1450,6 @@ void rtl92e_tx_enable(struct net_device *dev)
|
|||
rtllib_reset_queue(priv->rtllib);
|
||||
}
|
||||
|
||||
|
||||
static void _rtl92e_free_rx_ring(struct net_device *dev)
|
||||
{
|
||||
struct r8192_priv *priv = rtllib_priv(dev);
|
||||
|
@ -1599,7 +1507,7 @@ static void _rtl92e_hard_data_xmit(struct sk_buff *skb, struct net_device *dev,
|
|||
MAX_DEV_ADDR_SIZE);
|
||||
u8 queue_index = tcb_desc->queue_index;
|
||||
|
||||
if ((priv->rtllib->eRFPowerState == eRfOff) || !priv->up ||
|
||||
if ((priv->rtllib->rf_power_state == rf_off) || !priv->up ||
|
||||
priv->bResetInProgress) {
|
||||
kfree_skb(skb);
|
||||
return;
|
||||
|
@ -1632,7 +1540,7 @@ static int _rtl92e_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
|||
u8 queue_index = tcb_desc->queue_index;
|
||||
|
||||
if (queue_index != TXCMD_QUEUE) {
|
||||
if ((priv->rtllib->eRFPowerState == eRfOff) ||
|
||||
if ((priv->rtllib->rf_power_state == rf_off) ||
|
||||
!priv->up || priv->bResetInProgress) {
|
||||
kfree_skb(skb);
|
||||
return 0;
|
||||
|
@ -1936,13 +1844,11 @@ long rtl92e_translate_to_dbm(struct r8192_priv *priv, u8 signal_strength_index)
|
|||
return signal_power;
|
||||
}
|
||||
|
||||
|
||||
void rtl92e_update_rx_statistics(struct r8192_priv *priv,
|
||||
struct rtllib_rx_stats *pprevious_stats)
|
||||
{
|
||||
int weighting = 0;
|
||||
|
||||
|
||||
if (priv->stats.recv_signal_power == 0)
|
||||
priv->stats.recv_signal_power =
|
||||
pprevious_stats->RecvSignalPower;
|
||||
|
@ -1985,8 +1891,6 @@ void rtl92e_copy_mpdu_stats(struct rtllib_rx_stats *psrc_stats,
|
|||
ptarget_stats->bFirstMPDU = psrc_stats->bFirstMPDU;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void _rtl92e_rx_normal(struct net_device *dev)
|
||||
{
|
||||
struct r8192_priv *priv = rtllib_priv(dev);
|
||||
|
@ -2086,7 +1990,6 @@ done:
|
|||
priv->rx_idx[rx_queue_idx] = (priv->rx_idx[rx_queue_idx] + 1) %
|
||||
priv->rxringcount;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static void _rtl92e_tx_resume(struct net_device *dev)
|
||||
|
@ -2151,7 +2054,6 @@ static int _rtl92e_open(struct net_device *dev)
|
|||
ret = _rtl92e_try_up(dev);
|
||||
mutex_unlock(&priv->wx_mutex);
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
static int _rtl92e_try_up(struct net_device *dev)
|
||||
|
@ -2163,7 +2065,6 @@ static int _rtl92e_try_up(struct net_device *dev)
|
|||
return _rtl92e_up(dev, false);
|
||||
}
|
||||
|
||||
|
||||
static int _rtl92e_close(struct net_device *dev)
|
||||
{
|
||||
struct r8192_priv *priv = rtllib_priv(dev);
|
||||
|
@ -2181,7 +2082,6 @@ static int _rtl92e_close(struct net_device *dev)
|
|||
mutex_unlock(&priv->wx_mutex);
|
||||
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
static int _rtl92e_down(struct net_device *dev, bool shutdownrf)
|
||||
|
@ -2224,10 +2124,8 @@ static void _rtl92e_set_multicast(struct net_device *dev)
|
|||
|
||||
promisc = (dev->flags & IFF_PROMISC) ? 1 : 0;
|
||||
priv->promisc = promisc;
|
||||
|
||||
}
|
||||
|
||||
|
||||
static int _rtl92e_set_mac_adr(struct net_device *dev, void *mac)
|
||||
{
|
||||
struct r8192_priv *priv = rtllib_priv(dev);
|
||||
|
@ -2278,21 +2176,13 @@ static irqreturn_t _rtl92e_irq(int irq, void *netdev)
|
|||
goto done;
|
||||
}
|
||||
|
||||
if (inta & IMR_TBDOK) {
|
||||
RT_TRACE(COMP_INTR, "beacon ok interrupt!\n");
|
||||
if (inta & IMR_TBDOK)
|
||||
priv->stats.txbeaconokint++;
|
||||
}
|
||||
|
||||
if (inta & IMR_TBDER) {
|
||||
RT_TRACE(COMP_INTR, "beacon ok interrupt!\n");
|
||||
if (inta & IMR_TBDER)
|
||||
priv->stats.txbeaconerr++;
|
||||
}
|
||||
|
||||
if (inta & IMR_BDOK)
|
||||
RT_TRACE(COMP_INTR, "beacon interrupt!\n");
|
||||
|
||||
if (inta & IMR_MGNTDOK) {
|
||||
RT_TRACE(COMP_INTR, "Manage ok interrupt!\n");
|
||||
priv->stats.txmanageokint++;
|
||||
_rtl92e_tx_isr(dev, MGNT_QUEUE);
|
||||
spin_unlock_irqrestore(&priv->irq_th_lock, flags);
|
||||
|
@ -2319,13 +2209,10 @@ static irqreturn_t _rtl92e_irq(int irq, void *netdev)
|
|||
tasklet_schedule(&priv->irq_rx_tasklet);
|
||||
}
|
||||
|
||||
if (inta & IMR_BcnInt) {
|
||||
RT_TRACE(COMP_INTR, "prepare beacon for interrupt!\n");
|
||||
if (inta & IMR_BcnInt)
|
||||
tasklet_schedule(&priv->irq_prepare_beacon_tasklet);
|
||||
}
|
||||
|
||||
if (inta & IMR_RDU) {
|
||||
RT_TRACE(COMP_INTR, "rx descriptor unavailable!\n");
|
||||
priv->stats.rxrdu++;
|
||||
rtl92e_writel(dev, INTA_MASK,
|
||||
rtl92e_readl(dev, INTA_MASK) & ~IMR_RDU);
|
||||
|
@ -2333,7 +2220,6 @@ static irqreturn_t _rtl92e_irq(int irq, void *netdev)
|
|||
}
|
||||
|
||||
if (inta & IMR_RXFOVW) {
|
||||
RT_TRACE(COMP_INTR, "rx overflow !\n");
|
||||
priv->stats.rxoverflow++;
|
||||
tasklet_schedule(&priv->irq_rx_tasklet);
|
||||
}
|
||||
|
@ -2342,21 +2228,18 @@ static irqreturn_t _rtl92e_irq(int irq, void *netdev)
|
|||
priv->stats.txoverflow++;
|
||||
|
||||
if (inta & IMR_BKDOK) {
|
||||
RT_TRACE(COMP_INTR, "BK Tx OK interrupt!\n");
|
||||
priv->stats.txbkokint++;
|
||||
priv->rtllib->LinkDetectInfo.NumTxOkInPeriod++;
|
||||
_rtl92e_tx_isr(dev, BK_QUEUE);
|
||||
}
|
||||
|
||||
if (inta & IMR_BEDOK) {
|
||||
RT_TRACE(COMP_INTR, "BE TX OK interrupt!\n");
|
||||
priv->stats.txbeokint++;
|
||||
priv->rtllib->LinkDetectInfo.NumTxOkInPeriod++;
|
||||
_rtl92e_tx_isr(dev, BE_QUEUE);
|
||||
}
|
||||
|
||||
if (inta & IMR_VIDOK) {
|
||||
RT_TRACE(COMP_INTR, "VI TX OK interrupt!\n");
|
||||
priv->stats.txviokint++;
|
||||
priv->rtllib->LinkDetectInfo.NumTxOkInPeriod++;
|
||||
_rtl92e_tx_isr(dev, VI_QUEUE);
|
||||
|
@ -2364,7 +2247,6 @@ static irqreturn_t _rtl92e_irq(int irq, void *netdev)
|
|||
|
||||
if (inta & IMR_VODOK) {
|
||||
priv->stats.txvookint++;
|
||||
RT_TRACE(COMP_INTR, "Vo TX OK interrupt!\n");
|
||||
priv->rtllib->LinkDetectInfo.NumTxOkInPeriod++;
|
||||
_rtl92e_tx_isr(dev, VO_QUEUE);
|
||||
}
|
||||
|
@ -2376,8 +2258,6 @@ done:
|
|||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* ---------------------------- PCI_STUFF---------------------------
|
||||
****************************************************************************/
|
||||
|
@ -2402,8 +2282,6 @@ static int _rtl92e_pci_probe(struct pci_dev *pdev,
|
|||
int err = -ENOMEM;
|
||||
u8 revision_id;
|
||||
|
||||
RT_TRACE(COMP_INIT, "Configuring chip resources");
|
||||
|
||||
if (pci_enable_device(pdev)) {
|
||||
dev_err(&pdev->dev, "Failed to enable PCI device");
|
||||
return -EIO;
|
||||
|
@ -2452,7 +2330,6 @@ static int _rtl92e_pci_probe(struct pci_dev *pdev,
|
|||
goto err_rel_rtllib;
|
||||
}
|
||||
|
||||
|
||||
ioaddr = (unsigned long)ioremap(pmem_start, pmem_len);
|
||||
if (ioaddr == (unsigned long)NULL) {
|
||||
netdev_err(dev, "ioremap failed!");
|
||||
|
@ -2483,13 +2360,9 @@ static int _rtl92e_pci_probe(struct pci_dev *pdev,
|
|||
dev->type = ARPHRD_ETHER;
|
||||
dev->watchdog_timeo = HZ * 3;
|
||||
|
||||
if (dev_alloc_name(dev, ifname) < 0) {
|
||||
RT_TRACE(COMP_INIT,
|
||||
"Oops: devname already taken! Trying wlan%%d...\n");
|
||||
if (dev_alloc_name(dev, ifname) < 0)
|
||||
dev_alloc_name(dev, ifname);
|
||||
}
|
||||
|
||||
RT_TRACE(COMP_INIT, "Driver probe completed1\n");
|
||||
if (_rtl92e_init(dev) != 0) {
|
||||
netdev_warn(dev, "Initialization failed");
|
||||
goto err_free_irq;
|
||||
|
@ -2500,12 +2373,10 @@ static int _rtl92e_pci_probe(struct pci_dev *pdev,
|
|||
|
||||
if (register_netdev(dev))
|
||||
goto err_free_irq;
|
||||
RT_TRACE(COMP_INIT, "dev name: %s\n", dev->name);
|
||||
|
||||
if (priv->polling_timer_on == 0)
|
||||
rtl92e_check_rfctrl_gpio_timer(&priv->gpio_polling_timer);
|
||||
|
||||
RT_TRACE(COMP_INIT, "Driver probe completed\n");
|
||||
return 0;
|
||||
|
||||
err_free_irq:
|
||||
|
@ -2560,7 +2431,6 @@ static void _rtl92e_pci_disconnect(struct pci_dev *pdev)
|
|||
}
|
||||
|
||||
pci_disable_device(pdev);
|
||||
RT_TRACE(COMP_DOWN, "wlan driver removed\n");
|
||||
}
|
||||
|
||||
bool rtl92e_enable_nic(struct net_device *dev)
|
||||
|
@ -2576,7 +2446,6 @@ bool rtl92e_enable_nic(struct net_device *dev)
|
|||
return false;
|
||||
}
|
||||
|
||||
RT_TRACE(COMP_PS, "===========>%s()\n", __func__);
|
||||
priv->bfirst_init = true;
|
||||
init_status = priv->ops->initialize_adapter(dev);
|
||||
if (!init_status) {
|
||||
|
@ -2584,13 +2453,11 @@ bool rtl92e_enable_nic(struct net_device *dev)
|
|||
priv->bdisable_nic = false;
|
||||
return false;
|
||||
}
|
||||
RT_TRACE(COMP_INIT, "start adapter finished\n");
|
||||
RT_CLEAR_PS_LEVEL(pPSC, RT_RF_OFF_LEVL_HALT_NIC);
|
||||
priv->bfirst_init = false;
|
||||
|
||||
rtl92e_irq_enable(dev);
|
||||
priv->bdisable_nic = false;
|
||||
RT_TRACE(COMP_PS, "<===========%s()\n", __func__);
|
||||
return init_status;
|
||||
}
|
||||
|
||||
|
@ -2599,7 +2466,6 @@ bool rtl92e_disable_nic(struct net_device *dev)
|
|||
struct r8192_priv *priv = rtllib_priv(dev);
|
||||
u8 tmp_state = 0;
|
||||
|
||||
RT_TRACE(COMP_PS, "=========>%s()\n", __func__);
|
||||
priv->bdisable_nic = true;
|
||||
tmp_state = priv->rtllib->state;
|
||||
rtllib_softmac_stop_protocol(priv->rtllib, 0, false);
|
||||
|
@ -2608,8 +2474,6 @@ bool rtl92e_disable_nic(struct net_device *dev)
|
|||
rtl92e_irq_disable(dev);
|
||||
|
||||
priv->ops->stop_adapter(dev, false);
|
||||
RT_TRACE(COMP_PS, "<=========%s()\n", __func__);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -299,8 +299,8 @@ struct rtl819x_ops {
|
|||
void (*tx_enable)(struct net_device *dev);
|
||||
void (*interrupt_recognized)(struct net_device *dev,
|
||||
u32 *p_inta, u32 *p_intb);
|
||||
bool (*TxCheckStuckHandler)(struct net_device *dev);
|
||||
bool (*RxCheckStuckHandler)(struct net_device *dev);
|
||||
bool (*tx_check_stuck_handler)(struct net_device *dev);
|
||||
bool (*rx_check_stuck_handler)(struct net_device *dev);
|
||||
};
|
||||
|
||||
struct r8192_priv {
|
||||
|
@ -392,7 +392,7 @@ struct r8192_priv {
|
|||
u16 ShortRetryLimit;
|
||||
u16 LongRetryLimit;
|
||||
|
||||
bool bHwRadioOff;
|
||||
bool hw_radio_off;
|
||||
bool blinked_ingpio;
|
||||
u8 polling_timer_on;
|
||||
|
||||
|
@ -430,7 +430,7 @@ struct r8192_priv {
|
|||
|
||||
u16 basic_rate;
|
||||
u8 short_preamble;
|
||||
u8 dot11CurrentPreambleMode;
|
||||
u8 dot11_current_preamble_mode;
|
||||
u8 slot_time;
|
||||
u16 SifsTime;
|
||||
|
||||
|
@ -478,7 +478,7 @@ struct r8192_priv {
|
|||
bool bInPowerSaveMode;
|
||||
u8 bHwRfOffAction;
|
||||
|
||||
bool RFChangeInProgress;
|
||||
bool rf_change_in_progress;
|
||||
bool SetRFPowerStateInProgress;
|
||||
bool bdisable_nic;
|
||||
|
||||
|
@ -598,6 +598,6 @@ bool rtl92e_enable_nic(struct net_device *dev);
|
|||
bool rtl92e_disable_nic(struct net_device *dev);
|
||||
|
||||
bool rtl92e_set_rf_state(struct net_device *dev,
|
||||
enum rt_rf_power_state StateToSet,
|
||||
RT_RF_CHANGE_SOURCE ChangeSource);
|
||||
enum rt_rf_power_state state_to_set,
|
||||
RT_RF_CHANGE_SOURCE change_source);
|
||||
#endif
|
||||
|
|
|
@ -268,8 +268,6 @@ static void _rtl92e_dm_check_ac_dc_power(struct net_device *dev)
|
|||
NULL};
|
||||
|
||||
if (priv->ResetProgress == RESET_TYPE_SILENT) {
|
||||
RT_TRACE((COMP_INIT | COMP_POWER | COMP_RF),
|
||||
"GPIOChangeRFWorkItemCallBack(): Silent Reset!!!!!!!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -333,8 +331,6 @@ static void _rtl92e_dm_check_rate_adaptive(struct net_device *dev)
|
|||
static u8 ping_rssi_state;
|
||||
|
||||
if (!priv->up) {
|
||||
RT_TRACE(COMP_RATE,
|
||||
"<---- %s: driver is going to unload\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -347,9 +343,9 @@ static void _rtl92e_dm_check_rate_adaptive(struct net_device *dev)
|
|||
|
||||
if (priv->rtllib->state == RTLLIB_LINKED) {
|
||||
|
||||
bshort_gi_enabled = (pHTInfo->bCurTxBW40MHz &&
|
||||
bshort_gi_enabled = (pHTInfo->cur_tx_bw40mhz &&
|
||||
pHTInfo->bCurShortGI40MHz) ||
|
||||
(!pHTInfo->bCurTxBW40MHz &&
|
||||
(!pHTInfo->cur_tx_bw40mhz &&
|
||||
pHTInfo->bCurShortGI20MHz);
|
||||
|
||||
pra->upper_rssi_threshold_ratr =
|
||||
|
@ -423,9 +419,6 @@ static void _rtl92e_dm_check_rate_adaptive(struct net_device *dev)
|
|||
u32 ratr_value;
|
||||
|
||||
ratr_value = targetRATR;
|
||||
RT_TRACE(COMP_RATE,
|
||||
"currentRATR = %x, targetRATR = %x\n",
|
||||
currentRATR, targetRATR);
|
||||
if (priv->rf_type == RF_1T2R)
|
||||
ratr_value &= ~(RATE_ALL_OFDM_2SS);
|
||||
rtl92e_writel(dev, RATR0, ratr_value);
|
||||
|
@ -628,7 +621,6 @@ static void _rtl92e_dm_tx_power_tracking_callback_tssi(struct net_device *dev)
|
|||
u16 Avg_TSSI_Meas, TSSI_13dBm, Avg_TSSI_Meas_from_driver = 0;
|
||||
u32 delta = 0;
|
||||
|
||||
RT_TRACE(COMP_POWER_TRACKING, "%s()\n", __func__);
|
||||
rtl92e_writeb(dev, Pw_Track_Flag, 0);
|
||||
rtl92e_writeb(dev, FW_Busy_Flag, 0);
|
||||
priv->rtllib->bdynamic_txpower_enable = false;
|
||||
|
@ -637,10 +629,6 @@ static void _rtl92e_dm_tx_power_tracking_callback_tssi(struct net_device *dev)
|
|||
RF_Type = priv->rf_type;
|
||||
Value = (RF_Type<<8) | powerlevelOFDM24G;
|
||||
|
||||
RT_TRACE(COMP_POWER_TRACKING, "powerlevelOFDM24G = %x\n",
|
||||
powerlevelOFDM24G);
|
||||
|
||||
|
||||
for (j = 0; j <= 30; j++) {
|
||||
|
||||
tx_cmd.Op = TXCMD_SET_TX_PWR_TRACKING;
|
||||
|
@ -656,15 +644,11 @@ static void _rtl92e_dm_tx_power_tracking_callback_tssi(struct net_device *dev)
|
|||
mdelay(1);
|
||||
|
||||
if (priv->bResetInProgress) {
|
||||
RT_TRACE(COMP_POWER_TRACKING,
|
||||
"we are in silent reset progress, so return\n");
|
||||
rtl92e_writeb(dev, Pw_Track_Flag, 0);
|
||||
rtl92e_writeb(dev, FW_Busy_Flag, 0);
|
||||
return;
|
||||
}
|
||||
if (priv->rtllib->eRFPowerState != eRfOn) {
|
||||
RT_TRACE(COMP_POWER_TRACKING,
|
||||
"we are in power save, so return\n");
|
||||
if (priv->rtllib->rf_power_state != rf_on) {
|
||||
rtl92e_writeb(dev, Pw_Track_Flag, 0);
|
||||
rtl92e_writeb(dev, FW_Busy_Flag, 0);
|
||||
return;
|
||||
|
@ -689,10 +673,6 @@ static void _rtl92e_dm_tx_power_tracking_callback_tssi(struct net_device *dev)
|
|||
tmp_report[k] = rtl92e_readb(dev,
|
||||
Tssi_Report_Value2);
|
||||
|
||||
RT_TRACE(COMP_POWER_TRACKING,
|
||||
"TSSI_report_value = %d\n",
|
||||
tmp_report[k]);
|
||||
|
||||
if (tmp_report[k] <= 20) {
|
||||
viviflag = true;
|
||||
break;
|
||||
|
@ -702,8 +682,6 @@ static void _rtl92e_dm_tx_power_tracking_callback_tssi(struct net_device *dev)
|
|||
if (viviflag) {
|
||||
rtl92e_writeb(dev, Pw_Track_Flag, 0);
|
||||
viviflag = false;
|
||||
RT_TRACE(COMP_POWER_TRACKING,
|
||||
"we filted this data\n");
|
||||
for (k = 0; k < 5; k++)
|
||||
tmp_report[k] = 0;
|
||||
break;
|
||||
|
@ -713,12 +691,7 @@ static void _rtl92e_dm_tx_power_tracking_callback_tssi(struct net_device *dev)
|
|||
Avg_TSSI_Meas_from_driver += tmp_report[k];
|
||||
|
||||
Avg_TSSI_Meas_from_driver *= 100 / 5;
|
||||
RT_TRACE(COMP_POWER_TRACKING,
|
||||
"Avg_TSSI_Meas_from_driver = %d\n",
|
||||
Avg_TSSI_Meas_from_driver);
|
||||
TSSI_13dBm = priv->TSSI_13dBm;
|
||||
RT_TRACE(COMP_POWER_TRACKING, "TSSI_13dBm = %d\n",
|
||||
TSSI_13dBm);
|
||||
|
||||
if (Avg_TSSI_Meas_from_driver > TSSI_13dBm)
|
||||
delta = Avg_TSSI_Meas_from_driver - TSSI_13dBm;
|
||||
|
@ -729,20 +702,6 @@ static void _rtl92e_dm_tx_power_tracking_callback_tssi(struct net_device *dev)
|
|||
priv->rtllib->bdynamic_txpower_enable = true;
|
||||
rtl92e_writeb(dev, Pw_Track_Flag, 0);
|
||||
rtl92e_writeb(dev, FW_Busy_Flag, 0);
|
||||
RT_TRACE(COMP_POWER_TRACKING,
|
||||
"tx power track is done\n");
|
||||
RT_TRACE(COMP_POWER_TRACKING,
|
||||
"priv->rfa_txpowertrackingindex = %d\n",
|
||||
priv->rfa_txpowertrackingindex);
|
||||
RT_TRACE(COMP_POWER_TRACKING,
|
||||
"priv->rfa_txpowertrackingindex_real = %d\n",
|
||||
priv->rfa_txpowertrackingindex_real);
|
||||
RT_TRACE(COMP_POWER_TRACKING,
|
||||
"priv->CCKPresentAttentuation_difference = %d\n",
|
||||
priv->CCKPresentAttentuation_difference);
|
||||
RT_TRACE(COMP_POWER_TRACKING,
|
||||
"priv->CCKPresentAttentuation = %d\n",
|
||||
priv->CCKPresentAttentuation);
|
||||
return;
|
||||
}
|
||||
if (Avg_TSSI_Meas_from_driver < TSSI_13dBm - E_FOR_TX_POWER_TRACK)
|
||||
|
@ -785,26 +744,12 @@ static void _rtl92e_dm_tx_power_tracking_callback_tssi(struct net_device *dev)
|
|||
} else
|
||||
rtl92e_dm_cck_txpower_adjust(dev, priv->bcck_in_ch14);
|
||||
}
|
||||
RT_TRACE(COMP_POWER_TRACKING,
|
||||
"priv->rfa_txpowertrackingindex = %d\n",
|
||||
priv->rfa_txpowertrackingindex);
|
||||
RT_TRACE(COMP_POWER_TRACKING,
|
||||
"priv->rfa_txpowertrackingindex_real = %d\n",
|
||||
priv->rfa_txpowertrackingindex_real);
|
||||
RT_TRACE(COMP_POWER_TRACKING,
|
||||
"priv->CCKPresentAttentuation_difference = %d\n",
|
||||
priv->CCKPresentAttentuation_difference);
|
||||
RT_TRACE(COMP_POWER_TRACKING,
|
||||
"priv->CCKPresentAttentuation = %d\n",
|
||||
priv->CCKPresentAttentuation);
|
||||
|
||||
if (priv->CCKPresentAttentuation_difference <= -12 ||
|
||||
priv->CCKPresentAttentuation_difference >= 24) {
|
||||
priv->rtllib->bdynamic_txpower_enable = true;
|
||||
rtl92e_writeb(dev, Pw_Track_Flag, 0);
|
||||
rtl92e_writeb(dev, FW_Busy_Flag, 0);
|
||||
RT_TRACE(COMP_POWER_TRACKING,
|
||||
"tx power track--->limited\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -834,10 +779,6 @@ static void _rtl92e_dm_tx_power_tracking_cb_thermal(struct net_device *dev)
|
|||
for (i = 0; i < OFDM_Table_Length; i++) {
|
||||
if (tmpRegA == OFDMSwingTable[i]) {
|
||||
priv->OFDM_index[0] = i;
|
||||
RT_TRACE(COMP_POWER_TRACKING,
|
||||
"Initial reg0x%x = 0x%x, OFDM_index = 0x%x\n",
|
||||
rOFDM0_XATxIQImbalance, tmpRegA,
|
||||
priv->OFDM_index[0]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -845,10 +786,6 @@ static void _rtl92e_dm_tx_power_tracking_cb_thermal(struct net_device *dev)
|
|||
for (i = 0; i < CCK_Table_length; i++) {
|
||||
if (TempCCk == (u32)CCKSwingTable_Ch1_Ch13[i][0]) {
|
||||
priv->CCK_index = i;
|
||||
RT_TRACE(COMP_POWER_TRACKING,
|
||||
"Initial reg0x%x = 0x%x, CCK_index = 0x%x\n",
|
||||
rCCK0_TxFilter1, TempCCk,
|
||||
priv->CCK_index);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -857,12 +794,10 @@ static void _rtl92e_dm_tx_power_tracking_cb_thermal(struct net_device *dev)
|
|||
}
|
||||
|
||||
tmpRegA = rtl92e_get_rf_reg(dev, RF90_PATH_A, 0x12, 0x078);
|
||||
RT_TRACE(COMP_POWER_TRACKING, "Readback ThermalMeterA = %d\n", tmpRegA);
|
||||
if (tmpRegA < 3 || tmpRegA > 13)
|
||||
return;
|
||||
if (tmpRegA >= 12)
|
||||
tmpRegA = 12;
|
||||
RT_TRACE(COMP_POWER_TRACKING, "Valid ThermalMeterA = %d\n", tmpRegA);
|
||||
priv->ThermalMeter[0] = ThermalMeterVal;
|
||||
priv->ThermalMeter[1] = ThermalMeterVal;
|
||||
|
||||
|
@ -894,9 +829,6 @@ static void _rtl92e_dm_tx_power_tracking_cb_thermal(struct net_device *dev)
|
|||
|
||||
priv->Record_CCK_20Mindex = tmpCCK20Mindex;
|
||||
priv->Record_CCK_40Mindex = tmpCCK40Mindex;
|
||||
RT_TRACE(COMP_POWER_TRACKING,
|
||||
"Record_CCK_20Mindex / Record_CCK_40Mindex = %d / %d.\n",
|
||||
priv->Record_CCK_20Mindex, priv->Record_CCK_40Mindex);
|
||||
|
||||
if (priv->rtllib->current_network.channel == 14 &&
|
||||
!priv->bcck_in_ch14) {
|
||||
|
@ -919,9 +851,6 @@ static void _rtl92e_dm_tx_power_tracking_cb_thermal(struct net_device *dev)
|
|||
priv->OFDM_index[0] = tmpOFDMindex;
|
||||
rtl92e_set_bb_reg(dev, rOFDM0_XATxIQImbalance, bMaskDWord,
|
||||
OFDMSwingTable[priv->OFDM_index[0]]);
|
||||
RT_TRACE(COMP_POWER_TRACKING, "Update OFDMSwing[%d] = 0x%x\n",
|
||||
priv->OFDM_index[0],
|
||||
OFDMSwingTable[priv->OFDM_index[0]]);
|
||||
}
|
||||
priv->txpower_count = 0;
|
||||
}
|
||||
|
@ -960,8 +889,6 @@ static void _rtl92e_dm_init_tx_power_tracking_thermal(struct net_device *dev)
|
|||
priv->btxpower_tracking = false;
|
||||
priv->txpower_count = 0;
|
||||
priv->btxpower_trackingInit = false;
|
||||
RT_TRACE(COMP_POWER_TRACKING, "pMgntInfo->bTXPowerTracking = %d\n",
|
||||
priv->btxpower_tracking);
|
||||
}
|
||||
|
||||
void rtl92e_dm_init_txpower_tracking(struct net_device *dev)
|
||||
|
@ -979,7 +906,6 @@ static void _rtl92e_dm_check_tx_power_tracking_tssi(struct net_device *dev)
|
|||
struct r8192_priv *priv = rtllib_priv(dev);
|
||||
static u32 tx_power_track_counter;
|
||||
|
||||
RT_TRACE(COMP_POWER_TRACKING, "%s()\n", __func__);
|
||||
if (rtl92e_readb(dev, 0x11e) == 1)
|
||||
return;
|
||||
if (!priv->btxpower_tracking)
|
||||
|
@ -1086,44 +1012,29 @@ static void _rtl92e_dm_cck_tx_power_adjust_thermal_meter(struct net_device *dev,
|
|||
TempVal = CCKSwingTable_Ch1_Ch13[priv->CCK_index][0] +
|
||||
(CCKSwingTable_Ch1_Ch13[priv->CCK_index][1] << 8);
|
||||
rtl92e_set_bb_reg(dev, rCCK0_TxFilter1, bMaskHWord, TempVal);
|
||||
RT_TRACE(COMP_POWER_TRACKING,
|
||||
"CCK not chnl 14, reg 0x%x = 0x%x\n", rCCK0_TxFilter1,
|
||||
TempVal);
|
||||
TempVal = CCKSwingTable_Ch1_Ch13[priv->CCK_index][2] +
|
||||
(CCKSwingTable_Ch1_Ch13[priv->CCK_index][3] << 8) +
|
||||
(CCKSwingTable_Ch1_Ch13[priv->CCK_index][4] << 16)+
|
||||
(CCKSwingTable_Ch1_Ch13[priv->CCK_index][5] << 24);
|
||||
rtl92e_set_bb_reg(dev, rCCK0_TxFilter2, bMaskDWord, TempVal);
|
||||
RT_TRACE(COMP_POWER_TRACKING,
|
||||
"CCK not chnl 14, reg 0x%x = 0x%x\n", rCCK0_TxFilter2,
|
||||
TempVal);
|
||||
TempVal = CCKSwingTable_Ch1_Ch13[priv->CCK_index][6] +
|
||||
(CCKSwingTable_Ch1_Ch13[priv->CCK_index][7] << 8);
|
||||
|
||||
rtl92e_set_bb_reg(dev, rCCK0_DebugPort, bMaskLWord, TempVal);
|
||||
RT_TRACE(COMP_POWER_TRACKING,
|
||||
"CCK not chnl 14, reg 0x%x = 0x%x\n", rCCK0_DebugPort,
|
||||
TempVal);
|
||||
} else {
|
||||
TempVal = CCKSwingTable_Ch14[priv->CCK_index][0] +
|
||||
(CCKSwingTable_Ch14[priv->CCK_index][1] << 8);
|
||||
|
||||
rtl92e_set_bb_reg(dev, rCCK0_TxFilter1, bMaskHWord, TempVal);
|
||||
RT_TRACE(COMP_POWER_TRACKING, "CCK chnl 14, reg 0x%x = 0x%x\n",
|
||||
rCCK0_TxFilter1, TempVal);
|
||||
TempVal = CCKSwingTable_Ch14[priv->CCK_index][2] +
|
||||
(CCKSwingTable_Ch14[priv->CCK_index][3] << 8) +
|
||||
(CCKSwingTable_Ch14[priv->CCK_index][4] << 16)+
|
||||
(CCKSwingTable_Ch14[priv->CCK_index][5] << 24);
|
||||
rtl92e_set_bb_reg(dev, rCCK0_TxFilter2, bMaskDWord, TempVal);
|
||||
RT_TRACE(COMP_POWER_TRACKING, "CCK chnl 14, reg 0x%x = 0x%x\n",
|
||||
rCCK0_TxFilter2, TempVal);
|
||||
TempVal = CCKSwingTable_Ch14[priv->CCK_index][6] +
|
||||
(CCKSwingTable_Ch14[priv->CCK_index][7]<<8);
|
||||
|
||||
rtl92e_set_bb_reg(dev, rCCK0_DebugPort, bMaskLWord, TempVal);
|
||||
RT_TRACE(COMP_POWER_TRACKING, "CCK chnl 14, reg 0x%x = 0x%x\n",
|
||||
rCCK0_DebugPort, TempVal);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1141,32 +1052,12 @@ static void _rtl92e_dm_tx_power_reset_recovery(struct net_device *dev)
|
|||
{
|
||||
struct r8192_priv *priv = rtllib_priv(dev);
|
||||
|
||||
RT_TRACE(COMP_POWER_TRACKING, "Start Reset Recovery ==>\n");
|
||||
rtl92e_set_bb_reg(dev, rOFDM0_XATxIQImbalance, bMaskDWord,
|
||||
dm_tx_bb_gain[priv->rfa_txpowertrackingindex]);
|
||||
RT_TRACE(COMP_POWER_TRACKING, "Reset Recovery: Fill in 0xc80 is %08x\n",
|
||||
dm_tx_bb_gain[priv->rfa_txpowertrackingindex]);
|
||||
RT_TRACE(COMP_POWER_TRACKING,
|
||||
"Reset Recovery: Fill in RFA_txPowerTrackingIndex is %x\n",
|
||||
priv->rfa_txpowertrackingindex);
|
||||
RT_TRACE(COMP_POWER_TRACKING,
|
||||
"Reset Recovery : RF A I/Q Amplify Gain is %d\n",
|
||||
dm_tx_bb_gain_idx_to_amplify(priv->rfa_txpowertrackingindex));
|
||||
RT_TRACE(COMP_POWER_TRACKING,
|
||||
"Reset Recovery: CCK Attenuation is %d dB\n",
|
||||
priv->CCKPresentAttentuation);
|
||||
rtl92e_dm_cck_txpower_adjust(dev, priv->bcck_in_ch14);
|
||||
|
||||
rtl92e_set_bb_reg(dev, rOFDM0_XCTxIQImbalance, bMaskDWord,
|
||||
dm_tx_bb_gain[priv->rfc_txpowertrackingindex]);
|
||||
RT_TRACE(COMP_POWER_TRACKING, "Reset Recovery: Fill in 0xc90 is %08x\n",
|
||||
dm_tx_bb_gain[priv->rfc_txpowertrackingindex]);
|
||||
RT_TRACE(COMP_POWER_TRACKING,
|
||||
"Reset Recovery: Fill in RFC_txPowerTrackingIndex is %x\n",
|
||||
priv->rfc_txpowertrackingindex);
|
||||
RT_TRACE(COMP_POWER_TRACKING,
|
||||
"Reset Recovery : RF C I/Q Amplify Gain is %d\n",
|
||||
dm_tx_bb_gain_idx_to_amplify(priv->rfc_txpowertrackingindex));
|
||||
}
|
||||
|
||||
void rtl92e_dm_restore_state(struct net_device *dev)
|
||||
|
@ -1176,8 +1067,6 @@ void rtl92e_dm_restore_state(struct net_device *dev)
|
|||
u32 ratr_value;
|
||||
|
||||
if (!priv->up) {
|
||||
RT_TRACE(COMP_RATE,
|
||||
"<---- %s: driver is going to unload\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1218,17 +1107,6 @@ static void _rtl92e_dm_bb_initialgain_restore(struct net_device *dev)
|
|||
bit_mask = bMaskByte2;
|
||||
rtl92e_set_bb_reg(dev, rCCK0_CCA, bit_mask,
|
||||
(u32)priv->initgain_backup.cca);
|
||||
|
||||
RT_TRACE(COMP_DIG, "dm_BBInitialGainRestore 0xc50 is %x\n",
|
||||
priv->initgain_backup.xaagccore1);
|
||||
RT_TRACE(COMP_DIG, "dm_BBInitialGainRestore 0xc58 is %x\n",
|
||||
priv->initgain_backup.xbagccore1);
|
||||
RT_TRACE(COMP_DIG, "dm_BBInitialGainRestore 0xc60 is %x\n",
|
||||
priv->initgain_backup.xcagccore1);
|
||||
RT_TRACE(COMP_DIG, "dm_BBInitialGainRestore 0xc68 is %x\n",
|
||||
priv->initgain_backup.xdagccore1);
|
||||
RT_TRACE(COMP_DIG, "dm_BBInitialGainRestore 0xa0a is %x\n",
|
||||
priv->initgain_backup.cca);
|
||||
rtl92e_set_bb_reg(dev, UFWP, bMaskByte1, 0x1);
|
||||
|
||||
}
|
||||
|
@ -1251,17 +1129,6 @@ void rtl92e_dm_backup_state(struct net_device *dev)
|
|||
priv->initgain_backup.xdagccore1 = rtl92e_get_bb_reg(dev, rOFDM0_XDAGCCore1, bit_mask);
|
||||
bit_mask = bMaskByte2;
|
||||
priv->initgain_backup.cca = (u8)rtl92e_get_bb_reg(dev, rCCK0_CCA, bit_mask);
|
||||
|
||||
RT_TRACE(COMP_DIG, "BBInitialGainBackup 0xc50 is %x\n",
|
||||
priv->initgain_backup.xaagccore1);
|
||||
RT_TRACE(COMP_DIG, "BBInitialGainBackup 0xc58 is %x\n",
|
||||
priv->initgain_backup.xbagccore1);
|
||||
RT_TRACE(COMP_DIG, "BBInitialGainBackup 0xc60 is %x\n",
|
||||
priv->initgain_backup.xcagccore1);
|
||||
RT_TRACE(COMP_DIG, "BBInitialGainBackup 0xc68 is %x\n",
|
||||
priv->initgain_backup.xdagccore1);
|
||||
RT_TRACE(COMP_DIG, "BBInitialGainBackup 0xa0a is %x\n",
|
||||
priv->initgain_backup.cca);
|
||||
}
|
||||
|
||||
static void _rtl92e_dm_dig_init(struct net_device *dev)
|
||||
|
@ -1681,13 +1548,13 @@ static void _rtl92e_dm_check_edca_turbo(struct net_device *dev)
|
|||
goto dm_CheckEdcaTurbo_EXIT;
|
||||
if (priv->rtllib->state != RTLLIB_LINKED)
|
||||
goto dm_CheckEdcaTurbo_EXIT;
|
||||
if (priv->rtllib->pHTInfo->IOTAction & HT_IOT_ACT_DISABLE_EDCA_TURBO)
|
||||
if (priv->rtllib->pHTInfo->iot_action & HT_IOT_ACT_DISABLE_EDCA_TURBO)
|
||||
goto dm_CheckEdcaTurbo_EXIT;
|
||||
|
||||
if (!priv->rtllib->bis_any_nonbepkts) {
|
||||
curTxOkCnt = priv->stats.txbytesunicast - lastTxOkCnt;
|
||||
curRxOkCnt = priv->stats.rxbytesunicast - lastRxOkCnt;
|
||||
if (pHTInfo->IOTAction & HT_IOT_ACT_EDCA_BIAS_ON_RX) {
|
||||
if (pHTInfo->iot_action & HT_IOT_ACT_EDCA_BIAS_ON_RX) {
|
||||
if (curTxOkCnt > 4*curRxOkCnt) {
|
||||
if (priv->bis_cur_rdlstate ||
|
||||
!priv->bcurrent_turbo_EDCA) {
|
||||
|
@ -1766,16 +1633,16 @@ static void _rtl92e_dm_cts_to_self(struct net_device *dev)
|
|||
unsigned long curRxOkCnt = 0;
|
||||
|
||||
if (!priv->rtllib->bCTSToSelfEnable) {
|
||||
pHTInfo->IOTAction &= ~HT_IOT_ACT_FORCED_CTS2SELF;
|
||||
pHTInfo->iot_action &= ~HT_IOT_ACT_FORCED_CTS2SELF;
|
||||
return;
|
||||
}
|
||||
if (pHTInfo->IOTPeer == HT_IOT_PEER_BROADCOM) {
|
||||
curTxOkCnt = priv->stats.txbytesunicast - lastTxOkCnt;
|
||||
curRxOkCnt = priv->stats.rxbytesunicast - lastRxOkCnt;
|
||||
if (curRxOkCnt > 4*curTxOkCnt)
|
||||
pHTInfo->IOTAction &= ~HT_IOT_ACT_FORCED_CTS2SELF;
|
||||
pHTInfo->iot_action &= ~HT_IOT_ACT_FORCED_CTS2SELF;
|
||||
else
|
||||
pHTInfo->IOTAction |= HT_IOT_ACT_FORCED_CTS2SELF;
|
||||
pHTInfo->iot_action |= HT_IOT_ACT_FORCED_CTS2SELF;
|
||||
|
||||
lastTxOkCnt = priv->stats.txbytesunicast;
|
||||
lastRxOkCnt = priv->stats.rxbytesunicast;
|
||||
|
@ -1798,7 +1665,7 @@ static void _rtl92e_dm_check_rf_ctrl_gpio(void *data)
|
|||
struct r8192_priv, gpio_change_rf_wq);
|
||||
struct net_device *dev = priv->rtllib->dev;
|
||||
u8 tmp1byte;
|
||||
enum rt_rf_power_state eRfPowerStateToSet;
|
||||
enum rt_rf_power_state rf_power_state_to_set;
|
||||
bool bActuallySet = false;
|
||||
char *argv[3];
|
||||
static const char RadioPowerPath[] = "/etc/acpi/events/RadioPower.sh";
|
||||
|
@ -1817,25 +1684,23 @@ static void _rtl92e_dm_check_rf_ctrl_gpio(void *data)
|
|||
|
||||
tmp1byte = rtl92e_readb(dev, GPI);
|
||||
|
||||
eRfPowerStateToSet = (tmp1byte&BIT1) ? eRfOn : eRfOff;
|
||||
rf_power_state_to_set = (tmp1byte&BIT1) ? rf_on : rf_off;
|
||||
|
||||
if (priv->bHwRadioOff && (eRfPowerStateToSet == eRfOn)) {
|
||||
RT_TRACE(COMP_RF, "gpiochangeRF - HW Radio ON\n");
|
||||
if (priv->hw_radio_off && (rf_power_state_to_set == rf_on)) {
|
||||
netdev_info(dev, "gpiochangeRF - HW Radio ON\n");
|
||||
priv->bHwRadioOff = false;
|
||||
priv->hw_radio_off = false;
|
||||
bActuallySet = true;
|
||||
} else if (!priv->bHwRadioOff && (eRfPowerStateToSet == eRfOff)) {
|
||||
RT_TRACE(COMP_RF, "gpiochangeRF - HW Radio OFF\n");
|
||||
} else if (!priv->hw_radio_off && (rf_power_state_to_set == rf_off)) {
|
||||
netdev_info(dev, "gpiochangeRF - HW Radio OFF\n");
|
||||
priv->bHwRadioOff = true;
|
||||
priv->hw_radio_off = true;
|
||||
bActuallySet = true;
|
||||
}
|
||||
|
||||
if (bActuallySet) {
|
||||
mdelay(1000);
|
||||
priv->bHwRfOffAction = 1;
|
||||
rtl92e_set_rf_state(dev, eRfPowerStateToSet, RF_CHANGE_BY_HW);
|
||||
if (priv->bHwRadioOff)
|
||||
rtl92e_set_rf_state(dev, rf_power_state_to_set, RF_CHANGE_BY_HW);
|
||||
if (priv->hw_radio_off)
|
||||
argv[1] = "RFOFF";
|
||||
else
|
||||
argv[1] = "RFON";
|
||||
|
@ -2132,7 +1997,7 @@ static void _rtl92e_dm_fsync_timer_callback(struct timer_list *t)
|
|||
|
||||
if (priv->rtllib->state == RTLLIB_LINKED &&
|
||||
priv->rtllib->bfsync_enable &&
|
||||
(priv->rtllib->pHTInfo->IOTAction & HT_IOT_ACT_CDD_FSYNC)) {
|
||||
(priv->rtllib->pHTInfo->iot_action & HT_IOT_ACT_CDD_FSYNC)) {
|
||||
u32 rate_bitmap;
|
||||
|
||||
for (rate_index = 0; rate_index <= 27; rate_index++) {
|
||||
|
@ -2173,10 +2038,6 @@ static void _rtl92e_dm_fsync_timer_callback(struct timer_list *t)
|
|||
}
|
||||
priv->rate_record = rate_count;
|
||||
priv->rateCountDiffRecord = rate_count_diff;
|
||||
RT_TRACE(COMP_HALDM,
|
||||
"rateRecord %d rateCount %d, rateCountdiff %d bSwitchFsync %d\n",
|
||||
priv->rate_record, rate_count, rate_count_diff,
|
||||
priv->bswitch_fsync);
|
||||
if (priv->undecorated_smoothed_pwdb >
|
||||
priv->rtllib->fsync_rssi_threshold &&
|
||||
bSwitchFromCountDiff) {
|
||||
|
@ -2220,11 +2081,6 @@ static void _rtl92e_dm_fsync_timer_callback(struct timer_list *t)
|
|||
priv->ContinueDiffCount = 0;
|
||||
rtl92e_writel(dev, rOFDM0_RxDetector2, 0x465c52cd);
|
||||
}
|
||||
RT_TRACE(COMP_HALDM, "ContinueDiffCount %d\n", priv->ContinueDiffCount);
|
||||
RT_TRACE(COMP_HALDM,
|
||||
"rateRecord %d rateCount %d, rateCountdiff %d bSwitchFsync %d\n",
|
||||
priv->rate_record, rate_count, rate_count_diff,
|
||||
priv->bswitch_fsync);
|
||||
}
|
||||
|
||||
static void _rtl92e_dm_start_hw_fsync(struct net_device *dev)
|
||||
|
@ -2232,7 +2088,6 @@ static void _rtl92e_dm_start_hw_fsync(struct net_device *dev)
|
|||
u8 rf_timing = 0x77;
|
||||
struct r8192_priv *priv = rtllib_priv(dev);
|
||||
|
||||
RT_TRACE(COMP_HALDM, "%s\n", __func__);
|
||||
rtl92e_writel(dev, rOFDM0_RxDetector2, 0x465c12cf);
|
||||
priv->rtllib->SetHwRegHandler(dev, HW_VAR_RF_TIMING,
|
||||
(u8 *)(&rf_timing));
|
||||
|
@ -2244,7 +2099,6 @@ static void _rtl92e_dm_end_hw_fsync(struct net_device *dev)
|
|||
u8 rf_timing = 0xaa;
|
||||
struct r8192_priv *priv = rtllib_priv(dev);
|
||||
|
||||
RT_TRACE(COMP_HALDM, "%s\n", __func__);
|
||||
rtl92e_writel(dev, rOFDM0_RxDetector2, 0x465c52cd);
|
||||
priv->rtllib->SetHwRegHandler(dev, HW_VAR_RF_TIMING, (u8 *)
|
||||
(&rf_timing));
|
||||
|
@ -2255,7 +2109,6 @@ static void _rtl92e_dm_end_sw_fsync(struct net_device *dev)
|
|||
{
|
||||
struct r8192_priv *priv = rtllib_priv(dev);
|
||||
|
||||
RT_TRACE(COMP_HALDM, "%s\n", __func__);
|
||||
del_timer_sync(&(priv->fsync_timer));
|
||||
|
||||
if (priv->bswitch_fsync) {
|
||||
|
@ -2276,7 +2129,6 @@ static void _rtl92e_dm_start_sw_fsync(struct net_device *dev)
|
|||
u32 rateIndex;
|
||||
u32 rateBitmap;
|
||||
|
||||
RT_TRACE(COMP_HALDM, "%s\n", __func__);
|
||||
priv->rate_record = 0;
|
||||
priv->ContinueDiffCount = 0;
|
||||
priv->rateCountDiffRecord = 0;
|
||||
|
@ -2315,17 +2167,6 @@ static void _rtl92e_dm_check_fsync(struct net_device *dev)
|
|||
static u8 reg_c38_State = RegC38_Default;
|
||||
static u32 reset_cnt;
|
||||
|
||||
RT_TRACE(COMP_HALDM,
|
||||
"RSSI %d TimeInterval %d MultipleTimeInterval %d\n",
|
||||
priv->rtllib->fsync_rssi_threshold,
|
||||
priv->rtllib->fsync_time_interval,
|
||||
priv->rtllib->fsync_multiple_timeinterval);
|
||||
RT_TRACE(COMP_HALDM,
|
||||
"RateBitmap 0x%x FirstDiffRateThreshold %d SecondDiffRateThreshold %d\n",
|
||||
priv->rtllib->fsync_rate_bitmap,
|
||||
priv->rtllib->fsync_firstdiff_ratethreshold,
|
||||
priv->rtllib->fsync_seconddiff_ratethreshold);
|
||||
|
||||
if (priv->rtllib->state == RTLLIB_LINKED &&
|
||||
priv->rtllib->pHTInfo->IOTPeer == HT_IOT_PEER_BROADCOM) {
|
||||
if (priv->rtllib->bfsync_enable == 0) {
|
||||
|
@ -2461,9 +2302,6 @@ static void _rtl92e_dm_dynamic_tx_power(struct net_device *dev)
|
|||
txlowpower_threshold = TX_POWER_NEAR_FIELD_THRESH_LOW;
|
||||
}
|
||||
|
||||
RT_TRACE(COMP_TXAGC, "priv->undecorated_smoothed_pwdb = %ld\n",
|
||||
priv->undecorated_smoothed_pwdb);
|
||||
|
||||
if (priv->rtllib->state == RTLLIB_LINKED) {
|
||||
if (priv->undecorated_smoothed_pwdb >= txhipower_threshold) {
|
||||
priv->bDynamicTxHighPower = true;
|
||||
|
@ -2484,9 +2322,6 @@ static void _rtl92e_dm_dynamic_tx_power(struct net_device *dev)
|
|||
|
||||
if ((priv->bDynamicTxHighPower != priv->bLastDTPFlag_High) ||
|
||||
(priv->bDynamicTxLowPower != priv->bLastDTPFlag_Low)) {
|
||||
RT_TRACE(COMP_TXAGC, "SetTxPowerLevel8190() channel = %d\n",
|
||||
priv->rtllib->current_network.channel);
|
||||
|
||||
rtl92e_set_tx_power(dev, priv->rtllib->current_network.channel);
|
||||
}
|
||||
priv->bLastDTPFlag_High = priv->bDynamicTxHighPower;
|
||||
|
@ -2499,14 +2334,9 @@ static void _rtl92e_dm_check_txrateandretrycount(struct net_device *dev)
|
|||
struct r8192_priv *priv = rtllib_priv(dev);
|
||||
struct rtllib_device *ieee = priv->rtllib;
|
||||
|
||||
ieee->softmac_stats.CurrentShowTxate = rtl92e_readb(dev,
|
||||
Current_Tx_Rate_Reg);
|
||||
|
||||
ieee->softmac_stats.last_packet_rate = rtl92e_readb(dev,
|
||||
Initial_Tx_Rate_Reg);
|
||||
|
||||
ieee->softmac_stats.txretrycount = rtl92e_readl(dev,
|
||||
Tx_Retry_Count_Reg);
|
||||
ieee->softmac_stats.CurrentShowTxate = rtl92e_readb(dev, CURRENT_TX_RATE_REG);
|
||||
ieee->softmac_stats.last_packet_rate = rtl92e_readb(dev, INITIAL_TX_RATE_REG);
|
||||
ieee->softmac_stats.txretrycount = rtl92e_readl(dev, TX_RETRY_COUNT_REG);
|
||||
}
|
||||
|
||||
static void _rtl92e_dm_send_rssi_to_fw(struct net_device *dev)
|
||||
|
|
|
@ -42,9 +42,9 @@
|
|||
#define TX_POWER_ATHEROAP_THRESH_HIGH 78
|
||||
#define TX_POWER_ATHEROAP_THRESH_LOW 72
|
||||
|
||||
#define Current_Tx_Rate_Reg 0x1e0
|
||||
#define Initial_Tx_Rate_Reg 0x1e1
|
||||
#define Tx_Retry_Count_Reg 0x1ac
|
||||
#define CURRENT_TX_RATE_REG 0x1e0
|
||||
#define INITIAL_TX_RATE_REG 0x1e1
|
||||
#define TX_RETRY_COUNT_REG 0x1ac
|
||||
#define RegC38_TH 20
|
||||
|
||||
#define DM_Type_ByDriver 1
|
||||
|
|
|
@ -16,11 +16,9 @@ static void _rtl92e_parse_pci_configuration(struct pci_dev *pdev,
|
|||
struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev);
|
||||
|
||||
u8 tmp;
|
||||
u16 LinkCtrlReg;
|
||||
u16 link_ctrl_reg;
|
||||
|
||||
pcie_capability_read_word(priv->pdev, PCI_EXP_LNKCTL, &LinkCtrlReg);
|
||||
|
||||
RT_TRACE(COMP_INIT, "Link Control Register =%x\n", LinkCtrlReg);
|
||||
pcie_capability_read_word(priv->pdev, PCI_EXP_LNKCTL, &link_ctrl_reg);
|
||||
|
||||
pci_read_config_byte(pdev, 0x98, &tmp);
|
||||
tmp |= BIT4;
|
||||
|
@ -33,28 +31,28 @@ static void _rtl92e_parse_pci_configuration(struct pci_dev *pdev,
|
|||
bool rtl92e_check_adapter(struct pci_dev *pdev, struct net_device *dev)
|
||||
{
|
||||
struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev);
|
||||
u16 DeviceID;
|
||||
u8 RevisionID;
|
||||
u16 IrqLine;
|
||||
u16 device_id;
|
||||
u8 revision_id;
|
||||
u16 irq_line;
|
||||
|
||||
DeviceID = pdev->device;
|
||||
RevisionID = pdev->revision;
|
||||
pci_read_config_word(pdev, 0x3C, &IrqLine);
|
||||
device_id = pdev->device;
|
||||
revision_id = pdev->revision;
|
||||
pci_read_config_word(pdev, 0x3C, &irq_line);
|
||||
|
||||
priv->card_8192 = priv->ops->nic_type;
|
||||
|
||||
if (DeviceID == 0x8192) {
|
||||
switch (RevisionID) {
|
||||
if (device_id == 0x8192) {
|
||||
switch (revision_id) {
|
||||
case HAL_HW_PCI_REVISION_ID_8192PCIE:
|
||||
dev_info(&pdev->dev,
|
||||
"Adapter(8192 PCI-E) is found - DeviceID=%x\n",
|
||||
DeviceID);
|
||||
device_id);
|
||||
priv->card_8192 = NIC_8192E;
|
||||
break;
|
||||
case HAL_HW_PCI_REVISION_ID_8192SE:
|
||||
dev_info(&pdev->dev,
|
||||
"Adapter(8192SE) is found - DeviceID=%x\n",
|
||||
DeviceID);
|
||||
device_id);
|
||||
priv->card_8192 = NIC_8192SE;
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -32,7 +32,7 @@ int rtl92e_suspend(struct device *dev_d)
|
|||
netif_device_detach(dev);
|
||||
|
||||
if (!priv->rtllib->bSupportRemoteWakeUp) {
|
||||
rtl92e_set_rf_state(dev, eRfOff, RF_CHANGE_BY_INIT);
|
||||
rtl92e_set_rf_state(dev, rf_off, RF_CHANGE_BY_INIT);
|
||||
ulRegRead = rtl92e_readl(dev, CPU_GEN);
|
||||
ulRegRead |= CPU_GEN_SYSTEM_RESET;
|
||||
rtl92e_writel(dev, CPU_GEN, ulRegRead);
|
||||
|
@ -83,10 +83,9 @@ int rtl92e_resume(struct device *dev_d)
|
|||
dev->netdev_ops->ndo_open(dev);
|
||||
|
||||
if (!priv->rtllib->bSupportRemoteWakeUp)
|
||||
rtl92e_set_rf_state(dev, eRfOn, RF_CHANGE_BY_INIT);
|
||||
rtl92e_set_rf_state(dev, rf_on, RF_CHANGE_BY_INIT);
|
||||
|
||||
out:
|
||||
RT_TRACE(COMP_POWER, "<================r8192E resume call.\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -21,16 +21,12 @@ static void _rtl92e_hw_sleep(struct net_device *dev)
|
|||
unsigned long flags = 0;
|
||||
|
||||
spin_lock_irqsave(&priv->rf_ps_lock, flags);
|
||||
if (priv->RFChangeInProgress) {
|
||||
if (priv->rf_change_in_progress) {
|
||||
spin_unlock_irqrestore(&priv->rf_ps_lock, flags);
|
||||
RT_TRACE(COMP_DBG,
|
||||
"%s(): RF Change in progress!\n", __func__);
|
||||
return;
|
||||
}
|
||||
spin_unlock_irqrestore(&priv->rf_ps_lock, flags);
|
||||
RT_TRACE(COMP_DBG, "%s()============>come to sleep down\n", __func__);
|
||||
|
||||
rtl92e_set_rf_state(dev, eRfSleep, RF_CHANGE_BY_PS);
|
||||
rtl92e_set_rf_state(dev, rf_sleep, RF_CHANGE_BY_PS);
|
||||
}
|
||||
|
||||
void rtl92e_hw_sleep_wq(void *data)
|
||||
|
@ -48,17 +44,14 @@ void rtl92e_hw_wakeup(struct net_device *dev)
|
|||
unsigned long flags = 0;
|
||||
|
||||
spin_lock_irqsave(&priv->rf_ps_lock, flags);
|
||||
if (priv->RFChangeInProgress) {
|
||||
if (priv->rf_change_in_progress) {
|
||||
spin_unlock_irqrestore(&priv->rf_ps_lock, flags);
|
||||
RT_TRACE(COMP_DBG,
|
||||
"%s(): RF Change in progress!\n", __func__);
|
||||
schedule_delayed_work(&priv->rtllib->hw_wakeup_wq,
|
||||
msecs_to_jiffies(10));
|
||||
return;
|
||||
}
|
||||
spin_unlock_irqrestore(&priv->rf_ps_lock, flags);
|
||||
RT_TRACE(COMP_PS, "%s()============>come to wake up\n", __func__);
|
||||
rtl92e_set_rf_state(dev, eRfOn, RF_CHANGE_BY_PS);
|
||||
rtl92e_set_rf_state(dev, rf_on, RF_CHANGE_BY_PS);
|
||||
}
|
||||
|
||||
void rtl92e_hw_wakeup_wq(void *data)
|
||||
|
@ -110,15 +103,10 @@ static void _rtl92e_ps_update_rf_state(struct net_device *dev)
|
|||
struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
|
||||
&(priv->rtllib->PowerSaveControl);
|
||||
|
||||
RT_TRACE(COMP_PS, "%s() --------->\n", __func__);
|
||||
pPSC->bSwRfProcessing = true;
|
||||
|
||||
RT_TRACE(COMP_PS, "%s(): Set RF to %s.\n", __func__,
|
||||
pPSC->eInactivePowerState == eRfOff ? "OFF" : "ON");
|
||||
rtl92e_set_rf_state(dev, pPSC->eInactivePowerState, RF_CHANGE_BY_IPS);
|
||||
|
||||
pPSC->bSwRfProcessing = false;
|
||||
RT_TRACE(COMP_PS, "%s() <---------\n", __func__);
|
||||
}
|
||||
|
||||
void rtl92e_ips_enter(struct net_device *dev)
|
||||
|
@ -126,15 +114,14 @@ void rtl92e_ips_enter(struct net_device *dev)
|
|||
struct r8192_priv *priv = rtllib_priv(dev);
|
||||
struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
|
||||
&(priv->rtllib->PowerSaveControl);
|
||||
enum rt_rf_power_state rtState;
|
||||
enum rt_rf_power_state rt_state;
|
||||
|
||||
if (pPSC->bInactivePs) {
|
||||
rtState = priv->rtllib->eRFPowerState;
|
||||
if (rtState == eRfOn && !pPSC->bSwRfProcessing &&
|
||||
rt_state = priv->rtllib->rf_power_state;
|
||||
if (rt_state == rf_on && !pPSC->bSwRfProcessing &&
|
||||
(priv->rtllib->state != RTLLIB_LINKED) &&
|
||||
(priv->rtllib->iw_mode != IW_MODE_MASTER)) {
|
||||
RT_TRACE(COMP_PS, "%s(): Turn off RF.\n", __func__);
|
||||
pPSC->eInactivePowerState = eRfOff;
|
||||
pPSC->eInactivePowerState = rf_off;
|
||||
priv->isRFOff = true;
|
||||
priv->bInPowerSaveMode = true;
|
||||
_rtl92e_ps_update_rf_state(dev);
|
||||
|
@ -147,14 +134,13 @@ void rtl92e_ips_leave(struct net_device *dev)
|
|||
struct r8192_priv *priv = rtllib_priv(dev);
|
||||
struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
|
||||
&(priv->rtllib->PowerSaveControl);
|
||||
enum rt_rf_power_state rtState;
|
||||
enum rt_rf_power_state rt_state;
|
||||
|
||||
if (pPSC->bInactivePs) {
|
||||
rtState = priv->rtllib->eRFPowerState;
|
||||
if (rtState != eRfOn && !pPSC->bSwRfProcessing &&
|
||||
priv->rtllib->RfOffReason <= RF_CHANGE_BY_IPS) {
|
||||
RT_TRACE(COMP_PS, "%s(): Turn on RF.\n", __func__);
|
||||
pPSC->eInactivePowerState = eRfOn;
|
||||
rt_state = priv->rtllib->rf_power_state;
|
||||
if (rt_state != rf_on && !pPSC->bSwRfProcessing &&
|
||||
priv->rtllib->rf_off_reason <= RF_CHANGE_BY_IPS) {
|
||||
pPSC->eInactivePowerState = rf_on;
|
||||
priv->bInPowerSaveMode = false;
|
||||
_rtl92e_ps_update_rf_state(dev);
|
||||
}
|
||||
|
@ -176,13 +162,13 @@ void rtl92e_ips_leave_wq(void *data)
|
|||
void rtl92e_rtllib_ips_leave_wq(struct net_device *dev)
|
||||
{
|
||||
struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev);
|
||||
enum rt_rf_power_state rtState;
|
||||
enum rt_rf_power_state rt_state;
|
||||
|
||||
rtState = priv->rtllib->eRFPowerState;
|
||||
rt_state = priv->rtllib->rf_power_state;
|
||||
|
||||
if (priv->rtllib->PowerSaveControl.bInactivePs) {
|
||||
if (rtState == eRfOff) {
|
||||
if (priv->rtllib->RfOffReason > RF_CHANGE_BY_IPS) {
|
||||
if (rt_state == rf_off) {
|
||||
if (priv->rtllib->rf_off_reason > RF_CHANGE_BY_IPS) {
|
||||
netdev_warn(dev, "%s(): RF is OFF.\n",
|
||||
__func__);
|
||||
return;
|
||||
|
@ -210,7 +196,6 @@ static bool _rtl92e_ps_set_mode(struct net_device *dev, u8 rtPsMode)
|
|||
if (priv->rtllib->iw_mode == IW_MODE_ADHOC)
|
||||
return false;
|
||||
|
||||
RT_TRACE(COMP_LPS, "%s(): set ieee->ps = %x\n", __func__, rtPsMode);
|
||||
if (!priv->ps_force)
|
||||
priv->rtllib->ps = rtPsMode;
|
||||
if (priv->rtllib->sta_sleep != LPS_IS_WAKE &&
|
||||
|
@ -221,8 +206,6 @@ static bool _rtl92e_ps_set_mode(struct net_device *dev, u8 rtPsMode)
|
|||
priv->rtllib->sta_sleep = LPS_IS_WAKE;
|
||||
|
||||
spin_lock_irqsave(&(priv->rtllib->mgmt_tx_lock), flags);
|
||||
RT_TRACE(COMP_DBG,
|
||||
"LPS leave: notify AP we are awaked ++++++++++ SendNullFunctionData\n");
|
||||
rtllib_sta_ps_send_null_frame(priv->rtllib, 0);
|
||||
spin_unlock_irqrestore(&(priv->rtllib->mgmt_tx_lock), flags);
|
||||
}
|
||||
|
@ -236,12 +219,6 @@ void rtl92e_leisure_ps_enter(struct net_device *dev)
|
|||
struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
|
||||
&(priv->rtllib->PowerSaveControl);
|
||||
|
||||
RT_TRACE(COMP_PS, "%s()...\n", __func__);
|
||||
RT_TRACE(COMP_PS,
|
||||
"pPSC->bLeisurePs = %d, ieee->ps = %d,pPSC->LpsIdleCount is %d,RT_CHECK_FOR_HANG_PERIOD is %d\n",
|
||||
pPSC->bLeisurePs, priv->rtllib->ps, pPSC->LpsIdleCount,
|
||||
RT_CHECK_FOR_HANG_PERIOD);
|
||||
|
||||
if (!((priv->rtllib->iw_mode == IW_MODE_INFRA) &&
|
||||
(priv->rtllib->state == RTLLIB_LINKED))
|
||||
|| (priv->rtllib->iw_mode == IW_MODE_ADHOC) ||
|
||||
|
@ -252,10 +229,6 @@ void rtl92e_leisure_ps_enter(struct net_device *dev)
|
|||
if (pPSC->LpsIdleCount >= RT_CHECK_FOR_HANG_PERIOD) {
|
||||
|
||||
if (priv->rtllib->ps == RTLLIB_PS_DISABLED) {
|
||||
|
||||
RT_TRACE(COMP_LPS,
|
||||
"%s(): Enter 802.11 power save mode...\n", __func__);
|
||||
|
||||
if (!pPSC->bFwCtrlLPS) {
|
||||
if (priv->rtllib->SetFwCmdHandler)
|
||||
priv->rtllib->SetFwCmdHandler(
|
||||
|
@ -275,15 +248,8 @@ void rtl92e_leisure_ps_leave(struct net_device *dev)
|
|||
struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
|
||||
&(priv->rtllib->PowerSaveControl);
|
||||
|
||||
|
||||
RT_TRACE(COMP_PS, "%s()...\n", __func__);
|
||||
RT_TRACE(COMP_PS, "pPSC->bLeisurePs = %d, ieee->ps = %d\n",
|
||||
pPSC->bLeisurePs, priv->rtllib->ps);
|
||||
|
||||
if (pPSC->bLeisurePs) {
|
||||
if (priv->rtllib->ps != RTLLIB_PS_DISABLED) {
|
||||
RT_TRACE(COMP_LPS,
|
||||
"%s(): Busy Traffic , Leave 802.11 power save..\n", __func__);
|
||||
_rtl92e_ps_set_mode(dev, RTLLIB_PS_DISABLED);
|
||||
|
||||
if (!pPSC->bFwCtrlLPS) {
|
||||
|
|
|
@ -52,7 +52,7 @@ static int _rtl92e_wx_set_rate(struct net_device *dev,
|
|||
int ret;
|
||||
struct r8192_priv *priv = rtllib_priv(dev);
|
||||
|
||||
if (priv->bHwRadioOff)
|
||||
if (priv->hw_radio_off)
|
||||
return 0;
|
||||
|
||||
mutex_lock(&priv->wx_mutex);
|
||||
|
@ -71,7 +71,7 @@ static int _rtl92e_wx_set_rts(struct net_device *dev,
|
|||
int ret;
|
||||
struct r8192_priv *priv = rtllib_priv(dev);
|
||||
|
||||
if (priv->bHwRadioOff)
|
||||
if (priv->hw_radio_off)
|
||||
return 0;
|
||||
|
||||
mutex_lock(&priv->wx_mutex);
|
||||
|
@ -99,7 +99,7 @@ static int _rtl92e_wx_set_power(struct net_device *dev,
|
|||
int ret;
|
||||
struct r8192_priv *priv = rtllib_priv(dev);
|
||||
|
||||
if (priv->bHwRadioOff) {
|
||||
if (priv->hw_radio_off) {
|
||||
netdev_warn(dev, "%s(): Can't set Power: Radio is Off.\n",
|
||||
__func__);
|
||||
return 0;
|
||||
|
@ -129,7 +129,7 @@ static int _rtl92e_wx_set_rawtx(struct net_device *dev,
|
|||
struct r8192_priv *priv = rtllib_priv(dev);
|
||||
int ret;
|
||||
|
||||
if (priv->bHwRadioOff)
|
||||
if (priv->hw_radio_off)
|
||||
return 0;
|
||||
|
||||
mutex_lock(&priv->wx_mutex);
|
||||
|
@ -149,8 +149,6 @@ static int _rtl92e_wx_force_reset(struct net_device *dev,
|
|||
|
||||
mutex_lock(&priv->wx_mutex);
|
||||
|
||||
RT_TRACE(COMP_DBG, "%s(): force reset ! extra is %d\n",
|
||||
__func__, *extra);
|
||||
priv->force_reset = *extra;
|
||||
mutex_unlock(&priv->wx_mutex);
|
||||
return 0;
|
||||
|
@ -167,8 +165,6 @@ static int _rtl92e_wx_adapter_power_status(struct net_device *dev,
|
|||
|
||||
mutex_lock(&priv->wx_mutex);
|
||||
|
||||
RT_TRACE(COMP_POWER, "%s(): %s\n", __func__, (*extra == 6) ?
|
||||
"DC power" : "AC power");
|
||||
if (*extra || priv->force_lps) {
|
||||
priv->ps_force = false;
|
||||
pPSC->bLeisurePs = true;
|
||||
|
@ -228,7 +224,7 @@ static int _rtl92e_wx_set_debug(struct net_device *dev,
|
|||
struct r8192_priv *priv = rtllib_priv(dev);
|
||||
u8 c = *extra;
|
||||
|
||||
if (priv->bHwRadioOff)
|
||||
if (priv->hw_radio_off)
|
||||
return 0;
|
||||
|
||||
netdev_info(dev, "=====>%s(), *extra:%x, debugflag:%x\n", __func__,
|
||||
|
@ -247,18 +243,18 @@ static int _rtl92e_wx_set_mode(struct net_device *dev,
|
|||
struct r8192_priv *priv = rtllib_priv(dev);
|
||||
struct rtllib_device *ieee = netdev_priv_rsl(dev);
|
||||
|
||||
enum rt_rf_power_state rtState;
|
||||
enum rt_rf_power_state rt_state;
|
||||
int ret;
|
||||
|
||||
if (priv->bHwRadioOff)
|
||||
if (priv->hw_radio_off)
|
||||
return 0;
|
||||
rtState = priv->rtllib->eRFPowerState;
|
||||
rt_state = priv->rtllib->rf_power_state;
|
||||
mutex_lock(&priv->wx_mutex);
|
||||
if (wrqu->mode == IW_MODE_ADHOC || wrqu->mode == IW_MODE_MONITOR ||
|
||||
ieee->bNetPromiscuousMode) {
|
||||
if (priv->rtllib->PowerSaveControl.bInactivePs) {
|
||||
if (rtState == eRfOff) {
|
||||
if (priv->rtllib->RfOffReason >
|
||||
if (rt_state == rf_off) {
|
||||
if (priv->rtllib->rf_off_reason >
|
||||
RF_CHANGE_BY_IPS) {
|
||||
netdev_warn(dev, "%s(): RF is OFF.\n",
|
||||
__func__);
|
||||
|
@ -379,7 +375,7 @@ static int _rtl92e_wx_set_scan(struct net_device *dev,
|
|||
{
|
||||
struct r8192_priv *priv = rtllib_priv(dev);
|
||||
struct rtllib_device *ieee = priv->rtllib;
|
||||
enum rt_rf_power_state rtState;
|
||||
enum rt_rf_power_state rt_state;
|
||||
int ret;
|
||||
|
||||
if (!(ieee->softmac_features & IEEE_SOFTMAC_SCAN)) {
|
||||
|
@ -391,12 +387,12 @@ static int _rtl92e_wx_set_scan(struct net_device *dev,
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (priv->bHwRadioOff) {
|
||||
if (priv->hw_radio_off) {
|
||||
netdev_info(dev, "================>%s(): hwradio off\n",
|
||||
__func__);
|
||||
return 0;
|
||||
}
|
||||
rtState = priv->rtllib->eRFPowerState;
|
||||
rt_state = priv->rtllib->rf_power_state;
|
||||
if (!priv->up)
|
||||
return -ENETDOWN;
|
||||
if (priv->rtllib->LinkDetectInfo.bBusyTraffic == true)
|
||||
|
@ -419,17 +415,14 @@ static int _rtl92e_wx_set_scan(struct net_device *dev,
|
|||
|
||||
if (priv->rtllib->state != RTLLIB_LINKED) {
|
||||
if (priv->rtllib->PowerSaveControl.bInactivePs) {
|
||||
if (rtState == eRfOff) {
|
||||
if (priv->rtllib->RfOffReason >
|
||||
if (rt_state == rf_off) {
|
||||
if (priv->rtllib->rf_off_reason >
|
||||
RF_CHANGE_BY_IPS) {
|
||||
netdev_warn(dev, "%s(): RF is OFF.\n",
|
||||
__func__);
|
||||
mutex_unlock(&priv->wx_mutex);
|
||||
return -1;
|
||||
}
|
||||
RT_TRACE(COMP_PS,
|
||||
"=========>%s(): rtl92e_ips_leave\n",
|
||||
__func__);
|
||||
mutex_lock(&priv->rtllib->ips_mutex);
|
||||
rtl92e_ips_leave(dev);
|
||||
mutex_unlock(&priv->rtllib->ips_mutex);
|
||||
|
@ -440,7 +433,7 @@ static int _rtl92e_wx_set_scan(struct net_device *dev,
|
|||
priv->rtllib->LedControlHandler(dev,
|
||||
LED_CTL_SITE_SURVEY);
|
||||
|
||||
if (priv->rtllib->eRFPowerState != eRfOff) {
|
||||
if (priv->rtllib->rf_power_state != rf_off) {
|
||||
priv->rtllib->actscanning = true;
|
||||
|
||||
if (ieee->ScanOperationBackupHandler)
|
||||
|
@ -473,7 +466,7 @@ static int _rtl92e_wx_get_scan(struct net_device *dev,
|
|||
if (!priv->up)
|
||||
return -ENETDOWN;
|
||||
|
||||
if (priv->bHwRadioOff)
|
||||
if (priv->hw_radio_off)
|
||||
return 0;
|
||||
|
||||
mutex_lock(&priv->wx_mutex);
|
||||
|
@ -492,9 +485,9 @@ static int _rtl92e_wx_set_essid(struct net_device *dev,
|
|||
struct r8192_priv *priv = rtllib_priv(dev);
|
||||
int ret;
|
||||
|
||||
if (priv->bHwRadioOff) {
|
||||
if (priv->hw_radio_off) {
|
||||
netdev_info(dev,
|
||||
"=========>%s():hw radio off,or Rf state is eRfOff, return\n",
|
||||
"=========>%s():hw radio off,or Rf state is rf_off, return\n",
|
||||
__func__);
|
||||
return 0;
|
||||
}
|
||||
|
@ -560,7 +553,7 @@ static int _rtl92e_wx_set_freq(struct net_device *dev,
|
|||
int ret;
|
||||
struct r8192_priv *priv = rtllib_priv(dev);
|
||||
|
||||
if (priv->bHwRadioOff)
|
||||
if (priv->hw_radio_off)
|
||||
return 0;
|
||||
|
||||
mutex_lock(&priv->wx_mutex);
|
||||
|
@ -586,7 +579,7 @@ static int _rtl92e_wx_set_frag(struct net_device *dev,
|
|||
{
|
||||
struct r8192_priv *priv = rtllib_priv(dev);
|
||||
|
||||
if (priv->bHwRadioOff)
|
||||
if (priv->hw_radio_off)
|
||||
return 0;
|
||||
|
||||
if (wrqu->frag.disabled)
|
||||
|
@ -622,7 +615,7 @@ static int _rtl92e_wx_set_wap(struct net_device *dev,
|
|||
int ret;
|
||||
struct r8192_priv *priv = rtllib_priv(dev);
|
||||
|
||||
if (priv->bHwRadioOff)
|
||||
if (priv->hw_radio_off)
|
||||
return 0;
|
||||
|
||||
mutex_lock(&priv->wx_mutex);
|
||||
|
@ -669,7 +662,7 @@ static int _rtl92e_wx_set_enc(struct net_device *dev,
|
|||
{0x00, 0x00, 0x00, 0x00, 0x00, 0x03} };
|
||||
int i;
|
||||
|
||||
if (priv->bHwRadioOff)
|
||||
if (priv->hw_radio_off)
|
||||
return 0;
|
||||
|
||||
if (!priv->up)
|
||||
|
@ -681,7 +674,6 @@ static int _rtl92e_wx_set_enc(struct net_device *dev,
|
|||
mutex_unlock(&priv->rtllib->ips_mutex);
|
||||
mutex_lock(&priv->wx_mutex);
|
||||
|
||||
RT_TRACE(COMP_SEC, "Setting SW wep key");
|
||||
ret = rtllib_wx_set_encode(priv->rtllib, info, wrqu, key);
|
||||
mutex_unlock(&priv->wx_mutex);
|
||||
|
||||
|
@ -754,7 +746,7 @@ static int _rtl92e_wx_set_scan_type(struct net_device *dev,
|
|||
int *parms = (int *)p;
|
||||
int mode = parms[0];
|
||||
|
||||
if (priv->bHwRadioOff)
|
||||
if (priv->hw_radio_off)
|
||||
return 0;
|
||||
|
||||
priv->rtllib->active_scan = mode;
|
||||
|
@ -770,7 +762,7 @@ static int _rtl92e_wx_set_retry(struct net_device *dev,
|
|||
struct r8192_priv *priv = rtllib_priv(dev);
|
||||
int err = 0;
|
||||
|
||||
if (priv->bHwRadioOff)
|
||||
if (priv->hw_radio_off)
|
||||
return 0;
|
||||
|
||||
mutex_lock(&priv->wx_mutex);
|
||||
|
@ -843,7 +835,7 @@ static int _rtl92e_wx_set_sens(struct net_device *dev,
|
|||
|
||||
short err = 0;
|
||||
|
||||
if (priv->bHwRadioOff)
|
||||
if (priv->hw_radio_off)
|
||||
return 0;
|
||||
|
||||
mutex_lock(&priv->wx_mutex);
|
||||
|
@ -870,7 +862,7 @@ static int _rtl92e_wx_set_encode_ext(struct net_device *dev,
|
|||
struct r8192_priv *priv = rtllib_priv(dev);
|
||||
struct rtllib_device *ieee = priv->rtllib;
|
||||
|
||||
if (priv->bHwRadioOff)
|
||||
if (priv->hw_radio_off)
|
||||
return 0;
|
||||
|
||||
mutex_lock(&priv->wx_mutex);
|
||||
|
@ -950,7 +942,7 @@ static int _rtl92e_wx_set_auth(struct net_device *dev,
|
|||
|
||||
struct r8192_priv *priv = rtllib_priv(dev);
|
||||
|
||||
if (priv->bHwRadioOff)
|
||||
if (priv->hw_radio_off)
|
||||
return 0;
|
||||
|
||||
mutex_lock(&priv->wx_mutex);
|
||||
|
@ -967,7 +959,7 @@ static int _rtl92e_wx_set_mlme(struct net_device *dev,
|
|||
|
||||
struct r8192_priv *priv = rtllib_priv(dev);
|
||||
|
||||
if (priv->bHwRadioOff)
|
||||
if (priv->hw_radio_off)
|
||||
return 0;
|
||||
|
||||
mutex_lock(&priv->wx_mutex);
|
||||
|
@ -984,7 +976,7 @@ static int _rtl92e_wx_set_gen_ie(struct net_device *dev,
|
|||
|
||||
struct r8192_priv *priv = rtllib_priv(dev);
|
||||
|
||||
if (priv->bHwRadioOff)
|
||||
if (priv->hw_radio_off)
|
||||
return 0;
|
||||
|
||||
mutex_lock(&priv->wx_mutex);
|
||||
|
|
|
@ -100,8 +100,6 @@ static struct sk_buff *rtllib_ADDBA(struct rtllib_device *ieee, u8 *Dst,
|
|||
*tag++ = pBA->dialog_token;
|
||||
|
||||
if (type == ACT_ADDBARSP) {
|
||||
RT_TRACE(COMP_DBG, "====>to send ADDBARSP\n");
|
||||
|
||||
put_unaligned_le16(StatusCode, tag);
|
||||
tag += 2;
|
||||
}
|
||||
|
@ -183,7 +181,6 @@ static void rtllib_send_ADDBAReq(struct rtllib_device *ieee, u8 *dst,
|
|||
skb = rtllib_ADDBA(ieee, dst, pBA, 0, ACT_ADDBAREQ);
|
||||
|
||||
if (skb) {
|
||||
RT_TRACE(COMP_DBG, "====>to send ADDBAREQ!!!!!\n");
|
||||
softmac_mgmt_xmit(skb, ieee);
|
||||
} else {
|
||||
netdev_dbg(ieee->dev, "Failed to generate ADDBAReq packet.\n");
|
||||
|
@ -247,10 +244,9 @@ int rtllib_rx_ADDBAReq(struct rtllib_device *ieee, struct sk_buff *skb)
|
|||
pBaTimeoutVal = (u16 *)(tag + 5);
|
||||
pBaStartSeqCtrl = (union sequence_control *)(req + 7);
|
||||
|
||||
RT_TRACE(COMP_DBG, "====>rx ADDBAREQ from : %pM\n", dst);
|
||||
if (!ieee->current_network.qos_data.active ||
|
||||
!ieee->pHTInfo->bCurrentHTSupport ||
|
||||
(ieee->pHTInfo->IOTAction & HT_IOT_ACT_REJECT_ADDBA_REQ)) {
|
||||
(ieee->pHTInfo->iot_action & HT_IOT_ACT_REJECT_ADDBA_REQ)) {
|
||||
rc = ADDBA_STATUS_REFUSED;
|
||||
netdev_warn(ieee->dev,
|
||||
"Failed to reply on ADDBA_REQ as some capability is not ready(%d, %d)\n",
|
||||
|
@ -282,7 +278,7 @@ int rtllib_rx_ADDBAReq(struct rtllib_device *ieee, struct sk_buff *skb)
|
|||
pBA->ba_start_seq_ctrl = *pBaStartSeqCtrl;
|
||||
|
||||
if (ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev) ||
|
||||
(ieee->pHTInfo->IOTAction & HT_IOT_ACT_ALLOW_PEER_AGG_ONE_PKT))
|
||||
(ieee->pHTInfo->iot_action & HT_IOT_ACT_ALLOW_PEER_AGG_ONE_PKT))
|
||||
pBA->ba_param_set.field.buffer_size = 1;
|
||||
else
|
||||
pBA->ba_param_set.field.buffer_size = 32;
|
||||
|
@ -330,7 +326,6 @@ int rtllib_rx_ADDBARsp(struct rtllib_device *ieee, struct sk_buff *skb)
|
|||
pBaParamSet = (union ba_param_set *)(tag + 5);
|
||||
pBaTimeoutVal = (u16 *)(tag + 7);
|
||||
|
||||
RT_TRACE(COMP_DBG, "====>rx ADDBARSP from : %pM\n", dst);
|
||||
if (!ieee->current_network.qos_data.active ||
|
||||
!ieee->pHTInfo->bCurrentHTSupport ||
|
||||
!ieee->pHTInfo->bCurrentAMPDUEnable) {
|
||||
|
|
|
@ -131,51 +131,40 @@ struct rt_hi_throughput {
|
|||
u8 AMPDU_Factor;
|
||||
u8 CurrentAMPDUFactor;
|
||||
u8 MPDU_Density;
|
||||
u8 CurrentMPDUDensity;
|
||||
u8 current_mpdu_density;
|
||||
|
||||
enum ht_aggre_mode ForcedAMPDUMode;
|
||||
u8 ForcedAMPDUFactor;
|
||||
u8 ForcedMPDUDensity;
|
||||
u8 forced_ampdu_factor;
|
||||
u8 forced_mpdu_density;
|
||||
|
||||
enum ht_aggre_mode ForcedAMSDUMode;
|
||||
u16 ForcedAMSDUMaxSize;
|
||||
u8 forced_short_gi;
|
||||
|
||||
u8 bForcedShortGI;
|
||||
u8 current_op_mode;
|
||||
|
||||
u8 CurrentOpMode;
|
||||
|
||||
u8 SelfMimoPs;
|
||||
u8 PeerMimoPs;
|
||||
u8 self_mimo_ps;
|
||||
u8 peer_mimo_ps;
|
||||
|
||||
enum ht_extchnl_offset CurSTAExtChnlOffset;
|
||||
u8 bCurTxBW40MHz;
|
||||
u8 PeerBandwidth;
|
||||
|
||||
u8 bSwBwInProgress;
|
||||
u8 SwBwStep;
|
||||
|
||||
u8 bRegRT2RTAggregation;
|
||||
u8 cur_tx_bw40mhz;
|
||||
u8 sw_bw_in_progress;
|
||||
u8 reg_rt2rt_aggregation;
|
||||
u8 RT2RT_HT_Mode;
|
||||
u8 bCurrentRT2RTAggregation;
|
||||
u8 bCurrentRT2RTLongSlotTime;
|
||||
u8 szRT2RTAggBuffer[10];
|
||||
|
||||
u8 bRegRxReorderEnable;
|
||||
u8 bCurRxReorderEnable;
|
||||
u8 RxReorderWinSize;
|
||||
u8 RxReorderPendingTime;
|
||||
u16 RxReorderDropCounter;
|
||||
|
||||
u8 bIsPeerBcm;
|
||||
u8 current_rt2rt_aggregation;
|
||||
u8 current_rt2rt_long_slot_time;
|
||||
u8 sz_rt2rt_agg_buf[10];
|
||||
|
||||
u8 reg_rx_reorder_enable;
|
||||
u8 cur_rx_reorder_enable;
|
||||
u8 rx_reorder_win_size;
|
||||
u8 rx_reorder_pending_time;
|
||||
u16 rx_reorder_drop_counter;
|
||||
u8 IOTPeer;
|
||||
u32 IOTAction;
|
||||
u8 IOTRaFunc;
|
||||
u32 iot_action;
|
||||
u8 iot_ra_func;
|
||||
|
||||
u8 bWAIotBroadcom;
|
||||
u8 WAIotTH;
|
||||
|
||||
u8 bAcceptAddbaReq;
|
||||
} __packed;
|
||||
|
||||
struct bss_ht {
|
||||
|
|
|
@ -70,9 +70,6 @@ static u8 LINKSYS_MARVELL_4400N[3] = {0x00, 0x14, 0xa4};
|
|||
void HTUpdateDefaultSetting(struct rtllib_device *ieee)
|
||||
{
|
||||
struct rt_hi_throughput *pHTInfo = ieee->pHTInfo;
|
||||
|
||||
pHTInfo->bAcceptAddbaReq = 1;
|
||||
|
||||
pHTInfo->bRegShortGI20MHz = 1;
|
||||
pHTInfo->bRegShortGI40MHz = 1;
|
||||
|
||||
|
@ -90,19 +87,19 @@ void HTUpdateDefaultSetting(struct rtllib_device *ieee)
|
|||
pHTInfo->AMPDU_Factor = 2;
|
||||
pHTInfo->MPDU_Density = 0;
|
||||
|
||||
pHTInfo->SelfMimoPs = 3;
|
||||
if (pHTInfo->SelfMimoPs == 2)
|
||||
pHTInfo->SelfMimoPs = 3;
|
||||
pHTInfo->self_mimo_ps = 3;
|
||||
if (pHTInfo->self_mimo_ps == 2)
|
||||
pHTInfo->self_mimo_ps = 3;
|
||||
ieee->bTxDisableRateFallBack = 0;
|
||||
ieee->bTxUseDriverAssingedRate = 0;
|
||||
|
||||
ieee->bTxEnableFwCalcDur = 1;
|
||||
|
||||
pHTInfo->bRegRT2RTAggregation = 1;
|
||||
pHTInfo->reg_rt2rt_aggregation = 1;
|
||||
|
||||
pHTInfo->bRegRxReorderEnable = 1;
|
||||
pHTInfo->RxReorderWinSize = 64;
|
||||
pHTInfo->RxReorderPendingTime = 30;
|
||||
pHTInfo->reg_rx_reorder_enable = 1;
|
||||
pHTInfo->rx_reorder_win_size = 64;
|
||||
pHTInfo->rx_reorder_pending_time = 30;
|
||||
}
|
||||
|
||||
static u16 HTMcsToDataRate(struct rtllib_device *ieee, u8 nMcsRate)
|
||||
|
@ -254,20 +251,20 @@ static void HTIOTActDetermineRaFunc(struct rtllib_device *ieee, bool bPeerRx2ss)
|
|||
{
|
||||
struct rt_hi_throughput *pHTInfo = ieee->pHTInfo;
|
||||
|
||||
pHTInfo->IOTRaFunc &= HT_IOT_RAFUNC_DISABLE_ALL;
|
||||
pHTInfo->iot_ra_func &= HT_IOT_RAFUNC_DISABLE_ALL;
|
||||
|
||||
if (pHTInfo->IOTPeer == HT_IOT_PEER_RALINK && !bPeerRx2ss)
|
||||
pHTInfo->IOTRaFunc |= HT_IOT_RAFUNC_PEER_1R;
|
||||
pHTInfo->iot_ra_func |= HT_IOT_RAFUNC_PEER_1R;
|
||||
|
||||
if (pHTInfo->IOTAction & HT_IOT_ACT_AMSDU_ENABLE)
|
||||
pHTInfo->IOTRaFunc |= HT_IOT_RAFUNC_TX_AMSDU;
|
||||
if (pHTInfo->iot_action & HT_IOT_ACT_AMSDU_ENABLE)
|
||||
pHTInfo->iot_ra_func |= HT_IOT_RAFUNC_TX_AMSDU;
|
||||
}
|
||||
|
||||
void HTResetIOTSetting(struct rt_hi_throughput *pHTInfo)
|
||||
{
|
||||
pHTInfo->IOTAction = 0;
|
||||
pHTInfo->iot_action = 0;
|
||||
pHTInfo->IOTPeer = HT_IOT_PEER_UNKNOWN;
|
||||
pHTInfo->IOTRaFunc = 0;
|
||||
pHTInfo->iot_ra_func = 0;
|
||||
}
|
||||
|
||||
void HTConstructCapabilityElement(struct rtllib_device *ieee, u8 *posHTCap,
|
||||
|
@ -300,7 +297,7 @@ void HTConstructCapabilityElement(struct rtllib_device *ieee, u8 *posHTCap,
|
|||
else
|
||||
pCapELE->ChlWidth = (pHT->bRegBW40MHz ? 1 : 0);
|
||||
|
||||
pCapELE->MimoPwrSave = pHT->SelfMimoPs;
|
||||
pCapELE->MimoPwrSave = pHT->self_mimo_ps;
|
||||
pCapELE->GreenField = 0;
|
||||
pCapELE->ShortGI20Mhz = 1;
|
||||
pCapELE->ShortGI40Mhz = 1;
|
||||
|
@ -332,16 +329,16 @@ void HTConstructCapabilityElement(struct rtllib_device *ieee, u8 *posHTCap,
|
|||
pCapELE->ASCap = 0;
|
||||
|
||||
if (bAssoc) {
|
||||
if (pHT->IOTAction & HT_IOT_ACT_DISABLE_MCS15)
|
||||
if (pHT->iot_action & HT_IOT_ACT_DISABLE_MCS15)
|
||||
pCapELE->MCS[1] &= 0x7f;
|
||||
|
||||
if (pHT->IOTAction & HT_IOT_ACT_DISABLE_MCS14)
|
||||
if (pHT->iot_action & HT_IOT_ACT_DISABLE_MCS14)
|
||||
pCapELE->MCS[1] &= 0xbf;
|
||||
|
||||
if (pHT->IOTAction & HT_IOT_ACT_DISABLE_ALL_2SS)
|
||||
if (pHT->iot_action & HT_IOT_ACT_DISABLE_ALL_2SS)
|
||||
pCapELE->MCS[1] &= 0x00;
|
||||
|
||||
if (pHT->IOTAction & HT_IOT_ACT_DISABLE_RX_40MHZ_SHORT_GI)
|
||||
if (pHT->iot_action & HT_IOT_ACT_DISABLE_RX_40MHZ_SHORT_GI)
|
||||
pCapELE->ShortGI40Mhz = 0;
|
||||
|
||||
if (ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev)) {
|
||||
|
@ -377,7 +374,7 @@ void HTConstructInfoElement(struct rtllib_device *ieee, u8 *posHTInfo,
|
|||
pHTInfoEle->RIFS = 0;
|
||||
pHTInfoEle->PSMPAccessOnly = 0;
|
||||
pHTInfoEle->SrvIntGranularity = 0;
|
||||
pHTInfoEle->OptMode = pHT->CurrentOpMode;
|
||||
pHTInfoEle->OptMode = pHT->current_op_mode;
|
||||
pHTInfoEle->NonGFDevPresent = 0;
|
||||
pHTInfoEle->DualBeacon = 0;
|
||||
pHTInfoEle->SecondaryBeacon = 0;
|
||||
|
@ -506,7 +503,7 @@ static u8 HTFilterMCSRate(struct rtllib_device *ieee, u8 *pSupportMCS,
|
|||
}
|
||||
|
||||
void HTSetConnectBwMode(struct rtllib_device *ieee,
|
||||
enum ht_channel_width Bandwidth,
|
||||
enum ht_channel_width bandwidth,
|
||||
enum ht_extchnl_offset Offset);
|
||||
|
||||
void HTOnAssocRsp(struct rtllib_device *ieee)
|
||||
|
@ -543,7 +540,7 @@ void HTOnAssocRsp(struct rtllib_device *ieee)
|
|||
#endif
|
||||
HTSetConnectBwMode(ieee, (enum ht_channel_width)(pPeerHTCap->ChlWidth),
|
||||
(enum ht_extchnl_offset)(pPeerHTInfo->ExtChlOffset));
|
||||
pHTInfo->bCurTxBW40MHz = ((pPeerHTInfo->RecommemdedTxWidth == 1) ?
|
||||
pHTInfo->cur_tx_bw40mhz = ((pPeerHTInfo->RecommemdedTxWidth == 1) ?
|
||||
true : false);
|
||||
|
||||
pHTInfo->bCurShortGI20MHz = ((pHTInfo->bRegShortGI20MHz) ?
|
||||
|
@ -574,7 +571,7 @@ void HTOnAssocRsp(struct rtllib_device *ieee)
|
|||
pHTInfo->bCurrentAMPDUEnable = false;
|
||||
}
|
||||
|
||||
if (!pHTInfo->bRegRT2RTAggregation) {
|
||||
if (!pHTInfo->reg_rt2rt_aggregation) {
|
||||
if (pHTInfo->AMPDU_Factor > pPeerHTCap->MaxRxAMPDUFactor)
|
||||
pHTInfo->CurrentAMPDUFactor =
|
||||
pPeerHTCap->MaxRxAMPDUFactor;
|
||||
|
@ -597,15 +594,14 @@ void HTOnAssocRsp(struct rtllib_device *ieee)
|
|||
}
|
||||
}
|
||||
if (pHTInfo->MPDU_Density > pPeerHTCap->MPDUDensity)
|
||||
pHTInfo->CurrentMPDUDensity = pHTInfo->MPDU_Density;
|
||||
pHTInfo->current_mpdu_density = pHTInfo->MPDU_Density;
|
||||
else
|
||||
pHTInfo->CurrentMPDUDensity = pPeerHTCap->MPDUDensity;
|
||||
if (pHTInfo->IOTAction & HT_IOT_ACT_TX_USE_AMSDU_8K) {
|
||||
pHTInfo->current_mpdu_density = pPeerHTCap->MPDUDensity;
|
||||
if (pHTInfo->iot_action & HT_IOT_ACT_TX_USE_AMSDU_8K) {
|
||||
pHTInfo->bCurrentAMPDUEnable = false;
|
||||
pHTInfo->ForcedAMSDUMode = HT_AGG_FORCE_ENABLE;
|
||||
pHTInfo->ForcedAMSDUMaxSize = 7935;
|
||||
}
|
||||
pHTInfo->bCurRxReorderEnable = pHTInfo->bRegRxReorderEnable;
|
||||
pHTInfo->cur_rx_reorder_enable = pHTInfo->reg_rx_reorder_enable;
|
||||
|
||||
if (pPeerHTCap->MCS[0] == 0)
|
||||
pPeerHTCap->MCS[0] = 0xff;
|
||||
|
@ -614,8 +610,8 @@ void HTOnAssocRsp(struct rtllib_device *ieee)
|
|||
|
||||
HTFilterMCSRate(ieee, pPeerHTCap->MCS, ieee->dot11HTOperationalRateSet);
|
||||
|
||||
pHTInfo->PeerMimoPs = pPeerHTCap->MimoPwrSave;
|
||||
if (pHTInfo->PeerMimoPs == MIMO_PS_STATIC)
|
||||
pHTInfo->peer_mimo_ps = pPeerHTCap->MimoPwrSave;
|
||||
if (pHTInfo->peer_mimo_ps == MIMO_PS_STATIC)
|
||||
pMcsFilter = MCS_FILTER_1SS;
|
||||
else
|
||||
pMcsFilter = MCS_FILTER_ALL;
|
||||
|
@ -623,7 +619,7 @@ void HTOnAssocRsp(struct rtllib_device *ieee)
|
|||
ieee->dot11HTOperationalRateSet, pMcsFilter);
|
||||
ieee->HTCurrentOperaRate = ieee->HTHighestOperaRate;
|
||||
|
||||
pHTInfo->CurrentOpMode = pPeerHTInfo->OptMode;
|
||||
pHTInfo->current_op_mode = pPeerHTInfo->OptMode;
|
||||
}
|
||||
|
||||
void HTInitializeHTInfo(struct rtllib_device *ieee)
|
||||
|
@ -633,17 +629,17 @@ void HTInitializeHTInfo(struct rtllib_device *ieee)
|
|||
pHTInfo->bCurrentHTSupport = false;
|
||||
|
||||
pHTInfo->bCurBW40MHz = false;
|
||||
pHTInfo->bCurTxBW40MHz = false;
|
||||
pHTInfo->cur_tx_bw40mhz = false;
|
||||
|
||||
pHTInfo->bCurShortGI20MHz = false;
|
||||
pHTInfo->bCurShortGI40MHz = false;
|
||||
pHTInfo->bForcedShortGI = false;
|
||||
pHTInfo->forced_short_gi = false;
|
||||
|
||||
pHTInfo->bCurSuppCCK = true;
|
||||
|
||||
pHTInfo->bCurrent_AMSDU_Support = false;
|
||||
pHTInfo->nCurrent_AMSDU_MaxSize = pHTInfo->nAMSDU_MaxSize;
|
||||
pHTInfo->CurrentMPDUDensity = pHTInfo->MPDU_Density;
|
||||
pHTInfo->current_mpdu_density = pHTInfo->MPDU_Density;
|
||||
pHTInfo->CurrentAMPDUFactor = pHTInfo->AMPDU_Factor;
|
||||
|
||||
memset((void *)(&(pHTInfo->SelfHTCap)), 0,
|
||||
|
@ -655,17 +651,17 @@ void HTInitializeHTInfo(struct rtllib_device *ieee)
|
|||
memset((void *)(&(pHTInfo->PeerHTInfoBuf)), 0,
|
||||
sizeof(pHTInfo->PeerHTInfoBuf));
|
||||
|
||||
pHTInfo->bSwBwInProgress = false;
|
||||
pHTInfo->sw_bw_in_progress = false;
|
||||
|
||||
pHTInfo->ePeerHTSpecVer = HT_SPEC_VER_IEEE;
|
||||
|
||||
pHTInfo->bCurrentRT2RTAggregation = false;
|
||||
pHTInfo->bCurrentRT2RTLongSlotTime = false;
|
||||
pHTInfo->current_rt2rt_aggregation = false;
|
||||
pHTInfo->current_rt2rt_long_slot_time = false;
|
||||
pHTInfo->RT2RT_HT_Mode = (enum rt_ht_capability)0;
|
||||
|
||||
pHTInfo->IOTPeer = 0;
|
||||
pHTInfo->IOTAction = 0;
|
||||
pHTInfo->IOTRaFunc = 0;
|
||||
pHTInfo->iot_action = 0;
|
||||
pHTInfo->iot_ra_func = 0;
|
||||
|
||||
{
|
||||
u8 *RegHTSuppRateSets = &(ieee->RegHTSuppRateSet[0]);
|
||||
|
@ -717,51 +713,51 @@ void HTResetSelfAndSavePeerSetting(struct rtllib_device *ieee,
|
|||
pNetwork->bssht.bd_ht_info_buf,
|
||||
pNetwork->bssht.bd_ht_info_len);
|
||||
|
||||
if (pHTInfo->bRegRT2RTAggregation) {
|
||||
pHTInfo->bCurrentRT2RTAggregation =
|
||||
if (pHTInfo->reg_rt2rt_aggregation) {
|
||||
pHTInfo->current_rt2rt_aggregation =
|
||||
pNetwork->bssht.bd_rt2rt_aggregation;
|
||||
pHTInfo->bCurrentRT2RTLongSlotTime =
|
||||
pHTInfo->current_rt2rt_long_slot_time =
|
||||
pNetwork->bssht.bd_rt2rt_long_slot_time;
|
||||
pHTInfo->RT2RT_HT_Mode = pNetwork->bssht.rt2rt_ht_mode;
|
||||
} else {
|
||||
pHTInfo->bCurrentRT2RTAggregation = false;
|
||||
pHTInfo->bCurrentRT2RTLongSlotTime = false;
|
||||
pHTInfo->current_rt2rt_aggregation = false;
|
||||
pHTInfo->current_rt2rt_long_slot_time = false;
|
||||
pHTInfo->RT2RT_HT_Mode = (enum rt_ht_capability)0;
|
||||
}
|
||||
|
||||
HTIOTPeerDetermine(ieee);
|
||||
|
||||
pHTInfo->IOTAction = 0;
|
||||
pHTInfo->iot_action = 0;
|
||||
bIOTAction = HTIOTActIsDisableMCS14(ieee, pNetwork->bssid);
|
||||
if (bIOTAction)
|
||||
pHTInfo->IOTAction |= HT_IOT_ACT_DISABLE_MCS14;
|
||||
pHTInfo->iot_action |= HT_IOT_ACT_DISABLE_MCS14;
|
||||
|
||||
bIOTAction = HTIOTActIsDisableMCS15(ieee);
|
||||
if (bIOTAction)
|
||||
pHTInfo->IOTAction |= HT_IOT_ACT_DISABLE_MCS15;
|
||||
pHTInfo->iot_action |= HT_IOT_ACT_DISABLE_MCS15;
|
||||
|
||||
bIOTAction = HTIOTActIsDisableMCSTwoSpatialStream(ieee);
|
||||
if (bIOTAction)
|
||||
pHTInfo->IOTAction |= HT_IOT_ACT_DISABLE_ALL_2SS;
|
||||
pHTInfo->iot_action |= HT_IOT_ACT_DISABLE_ALL_2SS;
|
||||
|
||||
bIOTAction = HTIOTActIsDisableEDCATurbo(ieee, pNetwork->bssid);
|
||||
if (bIOTAction)
|
||||
pHTInfo->IOTAction |= HT_IOT_ACT_DISABLE_EDCA_TURBO;
|
||||
pHTInfo->iot_action |= HT_IOT_ACT_DISABLE_EDCA_TURBO;
|
||||
|
||||
bIOTAction = HTIOTActIsMgntUseCCK6M(ieee, pNetwork);
|
||||
if (bIOTAction)
|
||||
pHTInfo->IOTAction |= HT_IOT_ACT_MGNT_USE_CCK_6M;
|
||||
pHTInfo->iot_action |= HT_IOT_ACT_MGNT_USE_CCK_6M;
|
||||
bIOTAction = HTIOTActIsCCDFsync(ieee);
|
||||
if (bIOTAction)
|
||||
pHTInfo->IOTAction |= HT_IOT_ACT_CDD_FSYNC;
|
||||
pHTInfo->iot_action |= HT_IOT_ACT_CDD_FSYNC;
|
||||
} else {
|
||||
pHTInfo->bCurrentHTSupport = false;
|
||||
pHTInfo->bCurrentRT2RTAggregation = false;
|
||||
pHTInfo->bCurrentRT2RTLongSlotTime = false;
|
||||
pHTInfo->current_rt2rt_aggregation = false;
|
||||
pHTInfo->current_rt2rt_long_slot_time = false;
|
||||
pHTInfo->RT2RT_HT_Mode = (enum rt_ht_capability)0;
|
||||
|
||||
pHTInfo->IOTAction = 0;
|
||||
pHTInfo->IOTRaFunc = 0;
|
||||
pHTInfo->iot_action = 0;
|
||||
pHTInfo->iot_ra_func = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -774,7 +770,7 @@ void HT_update_self_and_peer_setting(struct rtllib_device *ieee,
|
|||
|
||||
if (pHTInfo->bCurrentHTSupport) {
|
||||
if (pNetwork->bssht.bd_ht_info_len != 0)
|
||||
pHTInfo->CurrentOpMode = pPeerHTInfo->OptMode;
|
||||
pHTInfo->current_op_mode = pPeerHTInfo->OptMode;
|
||||
}
|
||||
}
|
||||
EXPORT_SYMBOL(HT_update_self_and_peer_setting);
|
||||
|
@ -801,7 +797,7 @@ void HTUseDefaultSetting(struct rtllib_device *ieee)
|
|||
pHTInfo->bCurrentAMPDUEnable = pHTInfo->bAMPDUEnable;
|
||||
pHTInfo->CurrentAMPDUFactor = pHTInfo->AMPDU_Factor;
|
||||
|
||||
pHTInfo->CurrentMPDUDensity = pHTInfo->CurrentMPDUDensity;
|
||||
pHTInfo->current_mpdu_density = pHTInfo->current_mpdu_density;
|
||||
|
||||
HTFilterMCSRate(ieee, ieee->Regdot11TxHTOperationalRateSet,
|
||||
ieee->dot11HTOperationalRateSet);
|
||||
|
@ -850,11 +846,11 @@ static void HTSetConnectBwModeCallback(struct rtllib_device *ieee)
|
|||
HT_EXTCHNL_OFFSET_NO_EXT);
|
||||
}
|
||||
|
||||
pHTInfo->bSwBwInProgress = false;
|
||||
pHTInfo->sw_bw_in_progress = false;
|
||||
}
|
||||
|
||||
void HTSetConnectBwMode(struct rtllib_device *ieee,
|
||||
enum ht_channel_width Bandwidth,
|
||||
enum ht_channel_width bandwidth,
|
||||
enum ht_extchnl_offset Offset)
|
||||
{
|
||||
struct rt_hi_throughput *pHTInfo = ieee->pHTInfo;
|
||||
|
@ -863,13 +859,13 @@ void HTSetConnectBwMode(struct rtllib_device *ieee,
|
|||
return;
|
||||
|
||||
if (ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev))
|
||||
Bandwidth = HT_CHANNEL_WIDTH_20;
|
||||
bandwidth = HT_CHANNEL_WIDTH_20;
|
||||
|
||||
if (pHTInfo->bSwBwInProgress) {
|
||||
pr_info("%s: bSwBwInProgress!!\n", __func__);
|
||||
if (pHTInfo->sw_bw_in_progress) {
|
||||
pr_info("%s: sw_bw_in_progress!!\n", __func__);
|
||||
return;
|
||||
}
|
||||
if (Bandwidth == HT_CHANNEL_WIDTH_20_40) {
|
||||
if (bandwidth == HT_CHANNEL_WIDTH_20_40) {
|
||||
if (ieee->current_network.channel < 2 &&
|
||||
Offset == HT_EXTCHNL_OFFSET_LOWER)
|
||||
Offset = HT_EXTCHNL_OFFSET_NO_EXT;
|
||||
|
@ -889,7 +885,7 @@ void HTSetConnectBwMode(struct rtllib_device *ieee,
|
|||
netdev_dbg(ieee->dev, "%s():pHTInfo->bCurBW40MHz:%x\n", __func__,
|
||||
pHTInfo->bCurBW40MHz);
|
||||
|
||||
pHTInfo->bSwBwInProgress = true;
|
||||
pHTInfo->sw_bw_in_progress = true;
|
||||
|
||||
HTSetConnectBwModeCallback(ieee);
|
||||
}
|
||||
|
|
|
@ -83,7 +83,7 @@ static void RxPktPendingTimeout(struct timer_list *t)
|
|||
if (bPktInBuf && (pRxTs->rx_timeout_indicate_seq == 0xffff)) {
|
||||
pRxTs->rx_timeout_indicate_seq = pRxTs->rx_indicate_seq;
|
||||
mod_timer(&pRxTs->rx_pkt_pending_timer, jiffies +
|
||||
msecs_to_jiffies(ieee->pHTInfo->RxReorderPendingTime)
|
||||
msecs_to_jiffies(ieee->pHTInfo->rx_reorder_pending_time)
|
||||
);
|
||||
}
|
||||
spin_unlock_irqrestore(&(ieee->reorder_spinlock), flags);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue