mirror of https://github.com/torvalds/linux.git
Staging driver changes for 6.18-rc1
Here is the "big" set of staging driver changes for 6.18-rc1. Nothing really exciting in here they pretty much consist of: - minor coding style changes and cleanups - some api layer removals where not needed Overall a quiet development cycle. All have been in linux-next for a while with no reported issues. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> -----BEGIN PGP SIGNATURE----- iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCaOEmOw8cZ3JlZ0Brcm9h aC5jb20ACgkQMUfUDdst+ylVRwCfXpM+wxOkwxZlPeozj3c8GpLNhi0AoKPVFme2 Anq5D+005pjpOMvrUJug =frsM -----END PGP SIGNATURE----- Merge tag 'staging-6.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging Pull staging driver updates from Greg KH: "Here is the 'big' set of staging driver changes for 6.18-rc1. Nothing really exciting in here they pretty much consist of: - minor coding style changes and cleanups - some api layer removals where not needed Overall a quiet development cycle. All have been in linux-next for a while with no reported issues" * tag 'staging-6.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (63 commits) staging: rtl8723bs: xmit: rephrase comment and drop extra space staging: sm750fb: rename camel case variable staging: rtl8723bs: hal: put return type and function name on one line staging: rtl8723bs: fix typo in comment staging: sm750fb: rename snake case variables staging: sm750fb: remove unnecessary volatile qualifiers staging: rtl8723bs: rtw_efuse.h: simplify copyright banner staging: rtl8723bs: remove unused tables staging: rtl8723bs: Hal_EfuseParseAntennaDiversity_8723B is empty staging: rtl8723bs: remove REG_EFUSE_ACCESS_8723 and EFUSE_ACCESS_ON_8723 staging: rtl8723bs: remove bWrite from Hal_EfusePowerSwitch staging: rtl8723bs: remove wrapper Efuse_PowerSwitch staging: octeon: Clean up dead code in ethernet-tx.c staging: rtl8723bs: fix fortify warnings by using struct_group staging: gpib: use int type to store negative error codes staging: rtl8723bs: remove include/recv_osdep.h staging: rtl8723bs: remove os_dep/recv_linux.c staging: rtl8723bs: rename rtw_os_recv_indicate_pkt staging: rtl8723bs: move rtw_os_recv_indicate_pkt to rtw_recv.c staging: rtl8723bs: rename rtw_os_alloc_msdu_pkt ...
This commit is contained in:
commit
59697e061f
|
|
@ -107,6 +107,8 @@
|
||||||
static long read_timeout = 1000; /* ms to wait before read() times out */
|
static long read_timeout = 1000; /* ms to wait before read() times out */
|
||||||
static long write_timeout = 1000; /* ms to wait before write() times out */
|
static long write_timeout = 1000; /* ms to wait before write() times out */
|
||||||
|
|
||||||
|
static DEFINE_IDA(axis_fifo_ida);
|
||||||
|
|
||||||
/* ----------------------------
|
/* ----------------------------
|
||||||
* module command-line arguments
|
* module command-line arguments
|
||||||
* ----------------------------
|
* ----------------------------
|
||||||
|
|
@ -123,6 +125,7 @@ MODULE_PARM_DESC(write_timeout, "ms to wait before blocking write() timing out;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct axis_fifo {
|
struct axis_fifo {
|
||||||
|
int id;
|
||||||
int irq; /* interrupt */
|
int irq; /* interrupt */
|
||||||
void __iomem *base_addr; /* kernel space memory */
|
void __iomem *base_addr; /* kernel space memory */
|
||||||
|
|
||||||
|
|
@ -693,17 +696,11 @@ static int axis_fifo_probe(struct platform_device *pdev)
|
||||||
|
|
||||||
/* get iospace for the device and request physical memory */
|
/* get iospace for the device and request physical memory */
|
||||||
fifo->base_addr = devm_platform_get_and_ioremap_resource(pdev, 0, &r_mem);
|
fifo->base_addr = devm_platform_get_and_ioremap_resource(pdev, 0, &r_mem);
|
||||||
if (IS_ERR(fifo->base_addr)) {
|
if (IS_ERR(fifo->base_addr))
|
||||||
rc = PTR_ERR(fifo->base_addr);
|
return PTR_ERR(fifo->base_addr);
|
||||||
goto err_initial;
|
|
||||||
}
|
|
||||||
|
|
||||||
dev_dbg(fifo->dt_device, "remapped memory to 0x%p\n", fifo->base_addr);
|
dev_dbg(fifo->dt_device, "remapped memory to 0x%p\n", fifo->base_addr);
|
||||||
|
|
||||||
/* create unique device name */
|
|
||||||
snprintf(device_name, 32, "%s_%pa", DRIVER_NAME, &r_mem->start);
|
|
||||||
dev_dbg(fifo->dt_device, "device name [%s]\n", device_name);
|
|
||||||
|
|
||||||
/* ----------------------------
|
/* ----------------------------
|
||||||
* init IP
|
* init IP
|
||||||
* ----------------------------
|
* ----------------------------
|
||||||
|
|
@ -711,7 +708,7 @@ static int axis_fifo_probe(struct platform_device *pdev)
|
||||||
|
|
||||||
rc = axis_fifo_parse_dt(fifo);
|
rc = axis_fifo_parse_dt(fifo);
|
||||||
if (rc)
|
if (rc)
|
||||||
goto err_initial;
|
return rc;
|
||||||
|
|
||||||
reset_ip_core(fifo);
|
reset_ip_core(fifo);
|
||||||
|
|
||||||
|
|
@ -723,7 +720,7 @@ static int axis_fifo_probe(struct platform_device *pdev)
|
||||||
/* get IRQ resource */
|
/* get IRQ resource */
|
||||||
rc = platform_get_irq(pdev, 0);
|
rc = platform_get_irq(pdev, 0);
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
goto err_initial;
|
return rc;
|
||||||
|
|
||||||
/* request IRQ */
|
/* request IRQ */
|
||||||
fifo->irq = rc;
|
fifo->irq = rc;
|
||||||
|
|
@ -732,13 +729,18 @@ static int axis_fifo_probe(struct platform_device *pdev)
|
||||||
if (rc) {
|
if (rc) {
|
||||||
dev_err(fifo->dt_device, "couldn't allocate interrupt %i\n",
|
dev_err(fifo->dt_device, "couldn't allocate interrupt %i\n",
|
||||||
fifo->irq);
|
fifo->irq);
|
||||||
goto err_initial;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------------------
|
/* ----------------------------
|
||||||
* init char device
|
* init char device
|
||||||
* ----------------------------
|
* ----------------------------
|
||||||
*/
|
*/
|
||||||
|
fifo->id = ida_alloc(&axis_fifo_ida, GFP_KERNEL);
|
||||||
|
if (fifo->id < 0)
|
||||||
|
return fifo->id;
|
||||||
|
|
||||||
|
snprintf(device_name, 32, "%s%d", DRIVER_NAME, fifo->id);
|
||||||
|
|
||||||
/* create character device */
|
/* create character device */
|
||||||
fifo->miscdev.fops = &fops;
|
fifo->miscdev.fops = &fops;
|
||||||
|
|
@ -746,16 +748,14 @@ static int axis_fifo_probe(struct platform_device *pdev)
|
||||||
fifo->miscdev.name = device_name;
|
fifo->miscdev.name = device_name;
|
||||||
fifo->miscdev.parent = dev;
|
fifo->miscdev.parent = dev;
|
||||||
rc = misc_register(&fifo->miscdev);
|
rc = misc_register(&fifo->miscdev);
|
||||||
if (rc < 0)
|
if (rc < 0) {
|
||||||
goto err_initial;
|
ida_free(&axis_fifo_ida, fifo->id);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
axis_fifo_debugfs_init(fifo);
|
axis_fifo_debugfs_init(fifo);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
err_initial:
|
|
||||||
dev_set_drvdata(dev, NULL);
|
|
||||||
return rc;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void axis_fifo_remove(struct platform_device *pdev)
|
static void axis_fifo_remove(struct platform_device *pdev)
|
||||||
|
|
@ -765,7 +765,7 @@ static void axis_fifo_remove(struct platform_device *pdev)
|
||||||
|
|
||||||
debugfs_remove(fifo->debugfs_dir);
|
debugfs_remove(fifo->debugfs_dir);
|
||||||
misc_deregister(&fifo->miscdev);
|
misc_deregister(&fifo->miscdev);
|
||||||
dev_set_drvdata(dev, NULL);
|
ida_free(&axis_fifo_ida, fifo->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct of_device_id axis_fifo_of_match[] = {
|
static const struct of_device_id axis_fifo_of_match[] = {
|
||||||
|
|
@ -805,6 +805,7 @@ module_init(axis_fifo_init);
|
||||||
static void __exit axis_fifo_exit(void)
|
static void __exit axis_fifo_exit(void)
|
||||||
{
|
{
|
||||||
platform_driver_unregister(&axis_fifo_driver);
|
platform_driver_unregister(&axis_fifo_driver);
|
||||||
|
ida_destroy(&axis_fifo_ida);
|
||||||
}
|
}
|
||||||
|
|
||||||
module_exit(axis_fifo_exit);
|
module_exit(axis_fifo_exit);
|
||||||
|
|
|
||||||
|
|
@ -277,8 +277,8 @@ struct bb_priv {
|
||||||
int ndac_mode; /* nrfd interrupt mode 0/1 -> edge/levels */
|
int ndac_mode; /* nrfd interrupt mode 0/1 -> edge/levels */
|
||||||
int dav_tx; /* keep trace of DAV status while sending */
|
int dav_tx; /* keep trace of DAV status while sending */
|
||||||
int dav_rx; /* keep trace of DAV status while receiving */
|
int dav_rx; /* keep trace of DAV status while receiving */
|
||||||
u8 eos; // eos character
|
u8 eos; /* eos character */
|
||||||
short eos_flags; // eos mode
|
short eos_flags; /* eos mode */
|
||||||
short eos_check; /* eos check required in current operation ... */
|
short eos_check; /* eos check required in current operation ... */
|
||||||
short eos_check_8; /* ... with byte comparison */
|
short eos_check_8; /* ... with byte comparison */
|
||||||
short eos_mask_7; /* ... with 7 bit masked character */
|
short eos_mask_7; /* ... with 7 bit masked character */
|
||||||
|
|
@ -297,7 +297,7 @@ struct bb_priv {
|
||||||
size_t w_cnt;
|
size_t w_cnt;
|
||||||
size_t length;
|
size_t length;
|
||||||
u8 *w_buf;
|
u8 *w_buf;
|
||||||
spinlock_t rw_lock; // protect mods to rw_lock
|
spinlock_t rw_lock; /* protect mods to rw_lock */
|
||||||
int phase;
|
int phase;
|
||||||
int ndac_idle;
|
int ndac_idle;
|
||||||
int ndac_seq;
|
int ndac_seq;
|
||||||
|
|
@ -726,7 +726,7 @@ static irqreturn_t bb_SRQ_interrupt(int irq, void *arg)
|
||||||
static int bb_command(struct gpib_board *board, u8 *buffer,
|
static int bb_command(struct gpib_board *board, u8 *buffer,
|
||||||
size_t length, size_t *bytes_written)
|
size_t length, size_t *bytes_written)
|
||||||
{
|
{
|
||||||
size_t ret;
|
int ret;
|
||||||
struct bb_priv *priv = board->private_data;
|
struct bb_priv *priv = board->private_data;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
|
@ -1462,8 +1462,8 @@ static inline void SET_DIR_READ(struct bb_priv *priv)
|
||||||
gpiod_set_value(TE, 0); /* set NDAC and NRFD to transmit and DAV to receive */
|
gpiod_set_value(TE, 0); /* set NDAC and NRFD to transmit and DAV to receive */
|
||||||
}
|
}
|
||||||
|
|
||||||
gpiod_direction_output(NRFD, 0); // hold off the talker
|
gpiod_direction_output(NRFD, 0); /* hold off the talker */
|
||||||
gpiod_direction_output(NDAC, 0); // data not accepted
|
gpiod_direction_output(NDAC, 0); /* data not accepted */
|
||||||
|
|
||||||
priv->direction = DIR_READ;
|
priv->direction = DIR_READ;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -273,7 +273,8 @@ struct gpib_board {
|
||||||
struct mutex big_gpib_mutex;
|
struct mutex big_gpib_mutex;
|
||||||
/* pid of last process to lock the board mutex */
|
/* pid of last process to lock the board mutex */
|
||||||
pid_t locking_pid;
|
pid_t locking_pid;
|
||||||
spinlock_t locking_pid_spinlock; // lock for setting locking pid
|
/* lock for setting locking pid */
|
||||||
|
spinlock_t locking_pid_spinlock;
|
||||||
/* Spin lock for dealing with races with the interrupt handler */
|
/* Spin lock for dealing with races with the interrupt handler */
|
||||||
spinlock_t spinlock;
|
spinlock_t spinlock;
|
||||||
/* Watchdog timer to enable timeouts */
|
/* Watchdog timer to enable timeouts */
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ struct nec7210_priv {
|
||||||
u8 auxb_bits; // bits written to auxiliary register B
|
u8 auxb_bits; // bits written to auxiliary register B
|
||||||
// used to keep track of board's state, bit definitions given below
|
// used to keep track of board's state, bit definitions given below
|
||||||
unsigned long state;
|
unsigned long state;
|
||||||
/* lock for chips that extend the nec7210 registers by paging in alternate regs */
|
// lock for chips that extend the nec7210 registers by paging in alternate regs
|
||||||
spinlock_t register_page_lock;
|
spinlock_t register_page_lock;
|
||||||
// wrappers for outb, inb, readb, or writeb
|
// wrappers for outb, inb, readb, or writeb
|
||||||
u8 (*read_byte)(struct nec7210_priv *priv, unsigned int register_number);
|
u8 (*read_byte)(struct nec7210_priv *priv, unsigned int register_number);
|
||||||
|
|
|
||||||
|
|
@ -150,8 +150,8 @@ enum {
|
||||||
IMR0 = 0, /* interrupt mask 0 */
|
IMR0 = 0, /* interrupt mask 0 */
|
||||||
IMR1 = 1, /* interrupt mask 1 */
|
IMR1 = 1, /* interrupt mask 1 */
|
||||||
AUXCR = 3, /* auxiliary command */
|
AUXCR = 3, /* auxiliary command */
|
||||||
ADR = 4, // address register
|
ADR = 4, /* address register */
|
||||||
SPMR = 5, // serial poll mode register
|
SPMR = 5, /* serial poll mode register */
|
||||||
PPR = 6, /* parallel poll */
|
PPR = 6, /* parallel poll */
|
||||||
CDOR = 7, /* data out register */
|
CDOR = 7, /* data out register */
|
||||||
};
|
};
|
||||||
|
|
@ -250,8 +250,8 @@ enum bus_status_bits {
|
||||||
enum aux_cmd_bits {
|
enum aux_cmd_bits {
|
||||||
AUX_CS = 0x80, /* set bit instead of clearing it, used with commands marked 'd' below */
|
AUX_CS = 0x80, /* set bit instead of clearing it, used with commands marked 'd' below */
|
||||||
AUX_CHIP_RESET = 0x0, /* d Chip reset */
|
AUX_CHIP_RESET = 0x0, /* d Chip reset */
|
||||||
AUX_INVAL = 0x1, // release dac holdoff, invalid command byte
|
AUX_INVAL = 0x1, /* release dac holdoff, invalid command byte */
|
||||||
AUX_VAL = (AUX_INVAL | AUX_CS), // release dac holdoff, valid command byte
|
AUX_VAL = (AUX_INVAL | AUX_CS), /* release dac holdoff, valid command byte */
|
||||||
AUX_RHDF = 0x2, /* X Release RFD holdoff */
|
AUX_RHDF = 0x2, /* X Release RFD holdoff */
|
||||||
AUX_HLDA = 0x3, /* d holdoff on all data */
|
AUX_HLDA = 0x3, /* d holdoff on all data */
|
||||||
AUX_HLDE = 0x4, /* d holdoff on EOI only */
|
AUX_HLDE = 0x4, /* d holdoff on EOI only */
|
||||||
|
|
|
||||||
|
|
@ -32,11 +32,11 @@ enum {
|
||||||
CMDR = 0x1c, // command register
|
CMDR = 0x1c, // command register
|
||||||
TIMER = 0x1e, // timer register
|
TIMER = 0x1e, // timer register
|
||||||
|
|
||||||
STS1 = 0x10, /* T488 Status Register 1 */
|
STS1 = 0x10, // T488 Status Register 1
|
||||||
STS2 = 0x1c, /* T488 Status Register 2 */
|
STS2 = 0x1c, // T488 Status Register 2
|
||||||
ISR0 = IMR0,
|
ISR0 = IMR0,
|
||||||
ISR3 = 0x1a, /* T488 Interrupt Status Register 3 */
|
ISR3 = 0x1a, // T488 Interrupt Status Register 3
|
||||||
BCR = 0x1f, /* bus control/status register */
|
BCR = 0x1f, // bus control/status register
|
||||||
BSR = BCR,
|
BSR = BCR,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -129,7 +129,7 @@ enum isr3_bits {
|
||||||
};
|
};
|
||||||
|
|
||||||
enum keyreg_bits {
|
enum keyreg_bits {
|
||||||
MSTD = 0x20, // enable 350ns T1 delay
|
MSTD = 0x20, /* enable 350ns T1 delay */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* STS1 -- Status Register 1 (read only) */
|
/* STS1 -- Status Register 1 (read only) */
|
||||||
|
|
@ -157,7 +157,7 @@ enum tnt4882_aux_cmds {
|
||||||
AUX_9914 = 0x15, // switch to 9914 mode
|
AUX_9914 = 0x15, // switch to 9914 mode
|
||||||
AUX_REQT = 0x18,
|
AUX_REQT = 0x18,
|
||||||
AUX_REQF = 0x19,
|
AUX_REQF = 0x19,
|
||||||
AUX_PAGEIN = 0x50, /* page in alternate registers */
|
AUX_PAGEIN = 0x50, // page in alternate registers
|
||||||
AUX_HLDI = 0x51, // rfd holdoff immediately
|
AUX_HLDI = 0x51, // rfd holdoff immediately
|
||||||
AUX_CLEAR_END = 0x55,
|
AUX_CLEAR_END = 0x55,
|
||||||
AUX_7210 = 0x99, // switch to 7210 mode
|
AUX_7210 = 0x99, // switch to 7210 mode
|
||||||
|
|
|
||||||
|
|
@ -782,7 +782,7 @@ int nec7210_write(struct gpib_board *board, struct nec7210_priv *priv,
|
||||||
clear_bit(DEV_CLEAR_BN, &priv->state); // XXX
|
clear_bit(DEV_CLEAR_BN, &priv->state); // XXX
|
||||||
|
|
||||||
if (send_eoi)
|
if (send_eoi)
|
||||||
length-- ; /* save the last byte for sending EOI */
|
length-- ; // save the last byte for sending EOI
|
||||||
|
|
||||||
if (length > 0) {
|
if (length > 0) {
|
||||||
// isa dma transfer
|
// isa dma transfer
|
||||||
|
|
@ -1005,7 +1005,7 @@ void nec7210_board_online(struct nec7210_priv *priv, const struct gpib_board *bo
|
||||||
nec7210_primary_address(board, priv, board->pad);
|
nec7210_primary_address(board, priv, board->pad);
|
||||||
nec7210_secondary_address(board, priv, board->sad, board->sad >= 0);
|
nec7210_secondary_address(board, priv, board->sad, board->sad >= 0);
|
||||||
|
|
||||||
// enable interrupts
|
/* enable interrupts */
|
||||||
priv->reg_bits[IMR1] = HR_ERRIE | HR_DECIE | HR_ENDIE |
|
priv->reg_bits[IMR1] = HR_ERRIE | HR_DECIE | HR_ENDIE |
|
||||||
HR_DETIE | HR_CPTIE | HR_DOIE | HR_DIIE;
|
HR_DETIE | HR_CPTIE | HR_DOIE | HR_DIIE;
|
||||||
priv->reg_bits[IMR2] = IMR2_ENABLE_INTR_MASK;
|
priv->reg_bits[IMR2] = IMR2_ENABLE_INTR_MASK;
|
||||||
|
|
|
||||||
|
|
@ -145,7 +145,7 @@ enum ni_usb_error_codes {
|
||||||
* CIC with no listener
|
* CIC with no listener
|
||||||
*/
|
*/
|
||||||
NIUSB_NO_LISTENER_ERROR = 8,
|
NIUSB_NO_LISTENER_ERROR = 8,
|
||||||
// get NIUSB_TIMEOUT_ERROR on board read/write timeout
|
/* get NIUSB_TIMEOUT_ERROR on board read/write timeout */
|
||||||
NIUSB_TIMEOUT_ERROR = 10,
|
NIUSB_TIMEOUT_ERROR = 10,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -841,7 +841,7 @@ void tms9914_board_reset(struct tms9914_priv *priv)
|
||||||
|
|
||||||
/* parallel poll unconfigure */
|
/* parallel poll unconfigure */
|
||||||
write_byte(priv, 0, PPR);
|
write_byte(priv, 0, PPR);
|
||||||
// request for data holdoff
|
/* request for data holdoff */
|
||||||
tms9914_set_holdoff_mode(priv, TMS9914_HOLDOFF_ALL);
|
tms9914_set_holdoff_mode(priv, TMS9914_HOLDOFF_ALL);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(tms9914_board_reset);
|
EXPORT_SYMBOL_GPL(tms9914_board_reset);
|
||||||
|
|
@ -852,7 +852,7 @@ void tms9914_online(struct gpib_board *board, struct tms9914_priv *priv)
|
||||||
tms9914_primary_address(board, priv, board->pad);
|
tms9914_primary_address(board, priv, board->pad);
|
||||||
tms9914_secondary_address(board, priv, board->sad, board->sad >= 0);
|
tms9914_secondary_address(board, priv, board->sad, board->sad >= 0);
|
||||||
|
|
||||||
// enable tms9914 interrupts
|
/* enable tms9914 interrupts */
|
||||||
priv->imr0_bits |= HR_MACIE | HR_RLCIE | HR_ENDIE | HR_BOIE | HR_BIIE |
|
priv->imr0_bits |= HR_MACIE | HR_RLCIE | HR_ENDIE | HR_BOIE | HR_BIIE |
|
||||||
HR_SPASIE;
|
HR_SPASIE;
|
||||||
priv->imr1_bits |= HR_MAIE | HR_SRQIE | HR_UNCIE | HR_ERRIE | HR_IFCIE |
|
priv->imr1_bits |= HR_MAIE | HR_SRQIE | HR_UNCIE | HR_ERRIE | HR_IFCIE |
|
||||||
|
|
@ -861,7 +861,7 @@ void tms9914_online(struct gpib_board *board, struct tms9914_priv *priv)
|
||||||
write_byte(priv, priv->imr1_bits, IMR1);
|
write_byte(priv, priv->imr1_bits, IMR1);
|
||||||
write_byte(priv, AUX_DAI, AUXCR);
|
write_byte(priv, AUX_DAI, AUXCR);
|
||||||
|
|
||||||
// turn off reset state
|
/* turn off reset state */
|
||||||
write_byte(priv, AUX_CHIP_RESET, AUXCR);
|
write_byte(priv, AUX_CHIP_RESET, AUXCR);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(tms9914_online);
|
EXPORT_SYMBOL_GPL(tms9914_online);
|
||||||
|
|
|
||||||
|
|
@ -1522,7 +1522,6 @@ static void __exit tnt4882_exit_module(void)
|
||||||
#include <linux/moduleparam.h>
|
#include <linux/moduleparam.h>
|
||||||
#include <linux/ptrace.h>
|
#include <linux/ptrace.h>
|
||||||
#include <linux/timer.h>
|
#include <linux/timer.h>
|
||||||
#include <linux/ioport.h>
|
|
||||||
#include <linux/io.h>
|
#include <linux/io.h>
|
||||||
|
|
||||||
#include <pcmcia/cistpl.h>
|
#include <pcmcia/cistpl.h>
|
||||||
|
|
|
||||||
|
|
@ -573,42 +573,14 @@ netdev_tx_t cvm_oct_xmit_pow(struct sk_buff *skb, struct net_device *dev)
|
||||||
|
|
||||||
if (skb->protocol == htons(ETH_P_IP)) {
|
if (skb->protocol == htons(ETH_P_IP)) {
|
||||||
work->word2.s.ip_offset = 14;
|
work->word2.s.ip_offset = 14;
|
||||||
#if 0
|
|
||||||
work->word2.s.vlan_valid = 0; /* FIXME */
|
|
||||||
work->word2.s.vlan_cfi = 0; /* FIXME */
|
|
||||||
work->word2.s.vlan_id = 0; /* FIXME */
|
|
||||||
work->word2.s.dec_ipcomp = 0; /* FIXME */
|
|
||||||
#endif
|
|
||||||
work->word2.s.tcp_or_udp =
|
work->word2.s.tcp_or_udp =
|
||||||
(ip_hdr(skb)->protocol == IPPROTO_TCP) ||
|
(ip_hdr(skb)->protocol == IPPROTO_TCP) ||
|
||||||
(ip_hdr(skb)->protocol == IPPROTO_UDP);
|
(ip_hdr(skb)->protocol == IPPROTO_UDP);
|
||||||
#if 0
|
|
||||||
/* FIXME */
|
|
||||||
work->word2.s.dec_ipsec = 0;
|
|
||||||
/* We only support IPv4 right now */
|
|
||||||
work->word2.s.is_v6 = 0;
|
|
||||||
/* Hardware would set to zero */
|
|
||||||
work->word2.s.software = 0;
|
|
||||||
/* No error, packet is internal */
|
|
||||||
work->word2.s.L4_error = 0;
|
|
||||||
#endif
|
|
||||||
work->word2.s.is_frag = !((ip_hdr(skb)->frag_off == 0) ||
|
work->word2.s.is_frag = !((ip_hdr(skb)->frag_off == 0) ||
|
||||||
(ip_hdr(skb)->frag_off ==
|
(ip_hdr(skb)->frag_off ==
|
||||||
cpu_to_be16(1 << 14)));
|
cpu_to_be16(1 << 14)));
|
||||||
#if 0
|
|
||||||
/* Assume Linux is sending a good packet */
|
|
||||||
work->word2.s.IP_exc = 0;
|
|
||||||
#endif
|
|
||||||
work->word2.s.is_bcast = (skb->pkt_type == PACKET_BROADCAST);
|
work->word2.s.is_bcast = (skb->pkt_type == PACKET_BROADCAST);
|
||||||
work->word2.s.is_mcast = (skb->pkt_type == PACKET_MULTICAST);
|
work->word2.s.is_mcast = (skb->pkt_type == PACKET_MULTICAST);
|
||||||
#if 0
|
|
||||||
/* This is an IP packet */
|
|
||||||
work->word2.s.not_IP = 0;
|
|
||||||
/* No error, packet is internal */
|
|
||||||
work->word2.s.rcv_error = 0;
|
|
||||||
/* No error, packet is internal */
|
|
||||||
work->word2.s.err_code = 0;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* When copying the data, include 4 bytes of the
|
* When copying the data, include 4 bytes of the
|
||||||
|
|
@ -618,12 +590,6 @@ netdev_tx_t cvm_oct_xmit_pow(struct sk_buff *skb, struct net_device *dev)
|
||||||
memcpy(work->packet_data, skb->data + 10,
|
memcpy(work->packet_data, skb->data + 10,
|
||||||
sizeof(work->packet_data));
|
sizeof(work->packet_data));
|
||||||
} else {
|
} else {
|
||||||
#if 0
|
|
||||||
work->word2.snoip.vlan_valid = 0; /* FIXME */
|
|
||||||
work->word2.snoip.vlan_cfi = 0; /* FIXME */
|
|
||||||
work->word2.snoip.vlan_id = 0; /* FIXME */
|
|
||||||
work->word2.snoip.software = 0; /* Hardware would set to zero */
|
|
||||||
#endif
|
|
||||||
work->word2.snoip.is_rarp = skb->protocol == htons(ETH_P_RARP);
|
work->word2.snoip.is_rarp = skb->protocol == htons(ETH_P_RARP);
|
||||||
work->word2.snoip.is_arp = skb->protocol == htons(ETH_P_ARP);
|
work->word2.snoip.is_arp = skb->protocol == htons(ETH_P_ARP);
|
||||||
work->word2.snoip.is_bcast =
|
work->word2.snoip.is_bcast =
|
||||||
|
|
@ -631,12 +597,6 @@ netdev_tx_t cvm_oct_xmit_pow(struct sk_buff *skb, struct net_device *dev)
|
||||||
work->word2.snoip.is_mcast =
|
work->word2.snoip.is_mcast =
|
||||||
(skb->pkt_type == PACKET_MULTICAST);
|
(skb->pkt_type == PACKET_MULTICAST);
|
||||||
work->word2.snoip.not_IP = 1; /* IP was done up above */
|
work->word2.snoip.not_IP = 1; /* IP was done up above */
|
||||||
#if 0
|
|
||||||
/* No error, packet is internal */
|
|
||||||
work->word2.snoip.rcv_error = 0;
|
|
||||||
/* No error, packet is internal */
|
|
||||||
work->word2.snoip.err_code = 0;
|
|
||||||
#endif
|
|
||||||
memcpy(work->packet_data, skb->data, sizeof(work->packet_data));
|
memcpy(work->packet_data, skb->data, sizeof(work->packet_data));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,81 +43,83 @@
|
||||||
#define CVMX_POW_WQ_INT_PC 0
|
#define CVMX_POW_WQ_INT_PC 0
|
||||||
|
|
||||||
union cvmx_pip_wqe_word2 {
|
union cvmx_pip_wqe_word2 {
|
||||||
uint64_t u64;
|
u64 u64;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
uint64_t bufs:8;
|
u64 bufs : 8;
|
||||||
uint64_t ip_offset:8;
|
u64 ip_offset : 8;
|
||||||
uint64_t vlan_valid:1;
|
u64 vlan_valid : 1;
|
||||||
uint64_t vlan_stacked:1;
|
u64 vlan_stacked : 1;
|
||||||
uint64_t unassigned:1;
|
u64 unassigned : 1;
|
||||||
uint64_t vlan_cfi:1;
|
u64 vlan_cfi : 1;
|
||||||
uint64_t vlan_id:12;
|
u64 vlan_id : 12;
|
||||||
uint64_t pr:4;
|
u64 pr : 4;
|
||||||
uint64_t unassigned2:8;
|
u64 unassigned2 : 8;
|
||||||
uint64_t dec_ipcomp:1;
|
u64 dec_ipcomp : 1;
|
||||||
uint64_t tcp_or_udp:1;
|
u64 tcp_or_udp : 1;
|
||||||
uint64_t dec_ipsec:1;
|
u64 dec_ipsec : 1;
|
||||||
uint64_t is_v6:1;
|
u64 is_v6 : 1;
|
||||||
uint64_t software:1;
|
u64 software : 1;
|
||||||
uint64_t L4_error:1;
|
u64 L4_error : 1;
|
||||||
uint64_t is_frag:1;
|
u64 is_frag : 1;
|
||||||
uint64_t IP_exc:1;
|
u64 IP_exc : 1;
|
||||||
uint64_t is_bcast:1;
|
u64 is_bcast : 1;
|
||||||
uint64_t is_mcast:1;
|
u64 is_mcast : 1;
|
||||||
uint64_t not_IP:1;
|
u64 not_IP : 1;
|
||||||
uint64_t rcv_error:1;
|
u64 rcv_error : 1;
|
||||||
uint64_t err_code:8;
|
u64 err_code : 8;
|
||||||
} s;
|
} s;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
uint64_t bufs:8;
|
u64 bufs : 8;
|
||||||
uint64_t ip_offset:8;
|
u64 ip_offset : 8;
|
||||||
uint64_t vlan_valid:1;
|
u64 vlan_valid : 1;
|
||||||
uint64_t vlan_stacked:1;
|
u64 vlan_stacked : 1;
|
||||||
uint64_t unassigned:1;
|
u64 unassigned : 1;
|
||||||
uint64_t vlan_cfi:1;
|
u64 vlan_cfi : 1;
|
||||||
uint64_t vlan_id:12;
|
u64 vlan_id : 12;
|
||||||
uint64_t port:12;
|
u64 port : 12;
|
||||||
uint64_t dec_ipcomp:1;
|
u64 dec_ipcomp : 1;
|
||||||
uint64_t tcp_or_udp:1;
|
u64 tcp_or_udp : 1;
|
||||||
uint64_t dec_ipsec:1;
|
u64 dec_ipsec : 1;
|
||||||
uint64_t is_v6:1;
|
u64 is_v6 : 1;
|
||||||
uint64_t software:1;
|
u64 software : 1;
|
||||||
uint64_t L4_error:1;
|
u64 L4_error : 1;
|
||||||
uint64_t is_frag:1;
|
u64 is_frag : 1;
|
||||||
uint64_t IP_exc:1;
|
u64 IP_exc : 1;
|
||||||
uint64_t is_bcast:1;
|
u64 is_bcast : 1;
|
||||||
uint64_t is_mcast:1;
|
u64 is_mcast : 1;
|
||||||
uint64_t not_IP:1;
|
u64 not_IP : 1;
|
||||||
uint64_t rcv_error:1;
|
u64 rcv_error : 1;
|
||||||
uint64_t err_code:8;
|
u64 err_code : 8;
|
||||||
} s_cn68xx;
|
} s_cn68xx;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
uint64_t unused1:16;
|
u64 unused1 : 16;
|
||||||
uint64_t vlan:16;
|
u64 vlan : 16;
|
||||||
uint64_t unused2:32;
|
u64 unused2 : 32;
|
||||||
} svlan;
|
} svlan;
|
||||||
struct {
|
|
||||||
uint64_t bufs:8;
|
|
||||||
uint64_t unused:8;
|
|
||||||
uint64_t vlan_valid:1;
|
|
||||||
uint64_t vlan_stacked:1;
|
|
||||||
uint64_t unassigned:1;
|
|
||||||
uint64_t vlan_cfi:1;
|
|
||||||
uint64_t vlan_id:12;
|
|
||||||
uint64_t pr:4;
|
|
||||||
uint64_t unassigned2:12;
|
|
||||||
uint64_t software:1;
|
|
||||||
uint64_t unassigned3:1;
|
|
||||||
uint64_t is_rarp:1;
|
|
||||||
uint64_t is_arp:1;
|
|
||||||
uint64_t is_bcast:1;
|
|
||||||
uint64_t is_mcast:1;
|
|
||||||
uint64_t not_IP:1;
|
|
||||||
uint64_t rcv_error:1;
|
|
||||||
uint64_t err_code:8;
|
|
||||||
} snoip;
|
|
||||||
|
|
||||||
|
struct {
|
||||||
|
u64 bufs : 8;
|
||||||
|
u64 unused : 8;
|
||||||
|
u64 vlan_valid : 1;
|
||||||
|
u64 vlan_stacked : 1;
|
||||||
|
u64 unassigned : 1;
|
||||||
|
u64 vlan_cfi : 1;
|
||||||
|
u64 vlan_id : 12;
|
||||||
|
u64 pr : 4;
|
||||||
|
u64 unassigned2 : 12;
|
||||||
|
u64 software : 1;
|
||||||
|
u64 unassigned3 : 1;
|
||||||
|
u64 is_rarp : 1;
|
||||||
|
u64 is_arp : 1;
|
||||||
|
u64 is_bcast : 1;
|
||||||
|
u64 is_mcast : 1;
|
||||||
|
u64 not_IP : 1;
|
||||||
|
u64 rcv_error : 1;
|
||||||
|
u64 err_code : 8;
|
||||||
|
} snoip;
|
||||||
};
|
};
|
||||||
|
|
||||||
union cvmx_pip_wqe_word0 {
|
union cvmx_pip_wqe_word0 {
|
||||||
|
|
|
||||||
|
|
@ -48,10 +48,8 @@ r8723bs-y = \
|
||||||
hal/HalHWImg8723B_RF.o \
|
hal/HalHWImg8723B_RF.o \
|
||||||
hal/HalPhyRf_8723B.o \
|
hal/HalPhyRf_8723B.o \
|
||||||
os_dep/ioctl_cfg80211.o \
|
os_dep/ioctl_cfg80211.o \
|
||||||
os_dep/mlme_linux.o \
|
|
||||||
os_dep/osdep_service.o \
|
os_dep/osdep_service.o \
|
||||||
os_dep/os_intfs.o \
|
os_dep/os_intfs.o \
|
||||||
os_dep/recv_linux.o \
|
|
||||||
os_dep/sdio_intf.o \
|
os_dep/sdio_intf.o \
|
||||||
os_dep/sdio_ops_linux.o \
|
os_dep/sdio_ops_linux.o \
|
||||||
os_dep/wifi_regd.o \
|
os_dep/wifi_regd.o \
|
||||||
|
|
|
||||||
|
|
@ -258,11 +258,9 @@ void expire_timeout_chk(struct adapter *padapter)
|
||||||
} else {
|
} else {
|
||||||
/* TODO: Aging mechanism to digest frames in sleep_q to */
|
/* TODO: Aging mechanism to digest frames in sleep_q to */
|
||||||
/* avoid running out of xmitframe */
|
/* avoid running out of xmitframe */
|
||||||
if (psta->sleepq_len > (NR_XMITFRAME / pstapriv->asoc_list_cnt)
|
if (psta->sleepq_len > (NR_XMITFRAME / pstapriv->asoc_list_cnt) &&
|
||||||
&& padapter->xmitpriv.free_xmitframe_cnt < ((
|
padapter->xmitpriv.free_xmitframe_cnt <
|
||||||
NR_XMITFRAME / pstapriv->asoc_list_cnt
|
((NR_XMITFRAME / pstapriv->asoc_list_cnt) / 2))
|
||||||
) / 2)
|
|
||||||
)
|
|
||||||
wakeup_sta_to_xmit(padapter, psta);
|
wakeup_sta_to_xmit(padapter, psta);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,57 +29,6 @@ u8 fakeBTEfuseModifiedMap[EFUSE_BT_MAX_MAP_LEN] = {0};
|
||||||
#define REG_EFUSE_CTRL 0x0030
|
#define REG_EFUSE_CTRL 0x0030
|
||||||
#define EFUSE_CTRL REG_EFUSE_CTRL /* E-Fuse Control. */
|
#define EFUSE_CTRL REG_EFUSE_CTRL /* E-Fuse Control. */
|
||||||
|
|
||||||
static bool
|
|
||||||
Efuse_Read1ByteFromFakeContent(u16 Offset, u8 *Value)
|
|
||||||
{
|
|
||||||
if (Offset >= EFUSE_MAX_HW_SIZE)
|
|
||||||
return false;
|
|
||||||
if (fakeEfuseBank == 0)
|
|
||||||
*Value = fakeEfuseContent[Offset];
|
|
||||||
else
|
|
||||||
*Value = fakeBTEfuseContent[fakeEfuseBank - 1][Offset];
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool
|
|
||||||
Efuse_Write1ByteToFakeContent(u16 Offset, u8 Value)
|
|
||||||
{
|
|
||||||
if (Offset >= EFUSE_MAX_HW_SIZE)
|
|
||||||
return false;
|
|
||||||
if (fakeEfuseBank == 0)
|
|
||||||
fakeEfuseContent[Offset] = Value;
|
|
||||||
else
|
|
||||||
fakeBTEfuseContent[fakeEfuseBank - 1][Offset] = Value;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------------
|
|
||||||
* Function: Efuse_PowerSwitch
|
|
||||||
*
|
|
||||||
* Overview: When we want to enable write operation, we should change to
|
|
||||||
* pwr on state. When we stop write, we should switch to 500k mode
|
|
||||||
* and disable LDO 2.5V.
|
|
||||||
*
|
|
||||||
* Input: NONE
|
|
||||||
*
|
|
||||||
* Output: NONE
|
|
||||||
*
|
|
||||||
* Return: NONE
|
|
||||||
*
|
|
||||||
* Revised History:
|
|
||||||
* When Who Remark
|
|
||||||
* 11/17/2008 MHC Create Version 0.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
Efuse_PowerSwitch(
|
|
||||||
struct adapter *padapter,
|
|
||||||
u8 bWrite,
|
|
||||||
u8 PwrState)
|
|
||||||
{
|
|
||||||
Hal_EfusePowerSwitch(padapter, bWrite, PwrState);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 11/16/2008 MH Add description. Get current efuse area enabled word!!. */
|
/* 11/16/2008 MH Add description. Get current efuse area enabled word!!. */
|
||||||
u8
|
u8
|
||||||
Efuse_CalculateWordCnts(u8 word_en)
|
Efuse_CalculateWordCnts(u8 word_en)
|
||||||
|
|
@ -97,58 +46,6 @@ Efuse_CalculateWordCnts(u8 word_en)
|
||||||
return word_cnts;
|
return word_cnts;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* */
|
|
||||||
/* Description: */
|
|
||||||
/* 1. Execute E-Fuse read byte operation according as map offset and */
|
|
||||||
/* save to E-Fuse table. */
|
|
||||||
/* 2. Referred from SD1 Richard. */
|
|
||||||
/* */
|
|
||||||
/* Assumption: */
|
|
||||||
/* 1. Boot from E-Fuse and successfully auto-load. */
|
|
||||||
/* 2. PASSIVE_LEVEL (USB interface) */
|
|
||||||
/* */
|
|
||||||
/* Created by Roger, 2008.10.21. */
|
|
||||||
/* */
|
|
||||||
/* 2008/12/12 MH 1. Reorganize code flow and reserve bytes. and add description. */
|
|
||||||
/* 2. Add efuse utilization collect. */
|
|
||||||
/* 2008/12/22 MH Read Efuse must check if we write section 1 data again!!! Sec1 */
|
|
||||||
/* write addr must be after sec5. */
|
|
||||||
/* */
|
|
||||||
|
|
||||||
void
|
|
||||||
efuse_ReadEFuse(
|
|
||||||
struct adapter *Adapter,
|
|
||||||
u8 efuseType,
|
|
||||||
u16 _offset,
|
|
||||||
u16 _size_byte,
|
|
||||||
u8 *pbuf,
|
|
||||||
bool bPseudoTest
|
|
||||||
);
|
|
||||||
void
|
|
||||||
efuse_ReadEFuse(
|
|
||||||
struct adapter *Adapter,
|
|
||||||
u8 efuseType,
|
|
||||||
u16 _offset,
|
|
||||||
u16 _size_byte,
|
|
||||||
u8 *pbuf,
|
|
||||||
bool bPseudoTest
|
|
||||||
)
|
|
||||||
{
|
|
||||||
Hal_ReadEFuse(Adapter, efuseType, _offset, _size_byte, pbuf, bPseudoTest);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
EFUSE_GetEfuseDefinition(
|
|
||||||
struct adapter *padapter,
|
|
||||||
u8 efuseType,
|
|
||||||
u8 type,
|
|
||||||
void *pOut,
|
|
||||||
bool bPseudoTest
|
|
||||||
)
|
|
||||||
{
|
|
||||||
Hal_GetEfuseDefinition(padapter, efuseType, type, pOut, bPseudoTest);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------------
|
/*-----------------------------------------------------------------------------
|
||||||
* Function: EFUSE_Read1Byte
|
* Function: EFUSE_Read1Byte
|
||||||
*
|
*
|
||||||
|
|
@ -175,7 +72,7 @@ u16 Address)
|
||||||
u32 k = 0;
|
u32 k = 0;
|
||||||
u16 contentLen = 0;
|
u16 contentLen = 0;
|
||||||
|
|
||||||
EFUSE_GetEfuseDefinition(Adapter, EFUSE_WIFI, TYPE_EFUSE_REAL_CONTENT_LEN, (void *)&contentLen, false);
|
Hal_GetEfuseDefinition(Adapter, EFUSE_WIFI, TYPE_EFUSE_REAL_CONTENT_LEN, (void *)&contentLen);
|
||||||
|
|
||||||
if (Address < contentLen) {/* E-fuse 512Byte */
|
if (Address < contentLen) {/* E-fuse 512Byte */
|
||||||
/* Write E-fuse Register address bit0~7 */
|
/* Write E-fuse Register address bit0~7 */
|
||||||
|
|
@ -210,16 +107,12 @@ u8
|
||||||
efuse_OneByteRead(
|
efuse_OneByteRead(
|
||||||
struct adapter *padapter,
|
struct adapter *padapter,
|
||||||
u16 addr,
|
u16 addr,
|
||||||
u8 *data,
|
u8 *data)
|
||||||
bool bPseudoTest)
|
|
||||||
{
|
{
|
||||||
u32 tmpidx = 0;
|
u32 tmpidx = 0;
|
||||||
u8 bResult;
|
u8 bResult;
|
||||||
u8 readbyte;
|
u8 readbyte;
|
||||||
|
|
||||||
if (bPseudoTest)
|
|
||||||
return Efuse_Read1ByteFromFakeContent(addr, data);
|
|
||||||
|
|
||||||
/* <20130121, Kordan> For SMIC EFUSE specificatoin. */
|
/* <20130121, Kordan> For SMIC EFUSE specificatoin. */
|
||||||
/* 0x34[11]: SW force PGMEN input of efuse to high. (for the bank selected by 0x34[9:8]) */
|
/* 0x34[11]: SW force PGMEN input of efuse to high. (for the bank selected by 0x34[9:8]) */
|
||||||
/* PHY_SetMacReg(padapter, 0x34, BIT11, 0); */
|
/* PHY_SetMacReg(padapter, 0x34, BIT11, 0); */
|
||||||
|
|
@ -251,42 +144,6 @@ bool bPseudoTest)
|
||||||
return bResult;
|
return bResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 11/16/2008 MH Write one byte to reald Efuse. */
|
|
||||||
u8 efuse_OneByteWrite(struct adapter *padapter, u16 addr, u8 data, bool bPseudoTest)
|
|
||||||
{
|
|
||||||
u8 tmpidx = 0;
|
|
||||||
u8 bResult = false;
|
|
||||||
|
|
||||||
if (bPseudoTest)
|
|
||||||
return Efuse_Write1ByteToFakeContent(addr, data);
|
|
||||||
|
|
||||||
/* -----------------e-fuse reg ctrl --------------------------------- */
|
|
||||||
/* address */
|
|
||||||
|
|
||||||
/* <20130227, Kordan> 8192E MP chip A-cut had better not set 0x34[11] until B-Cut. */
|
|
||||||
|
|
||||||
/* <20130121, Kordan> For SMIC EFUSE specificatoin. */
|
|
||||||
/* 0x34[11]: SW force PGMEN input of efuse to high. (for the bank selected by 0x34[9:8]) */
|
|
||||||
/* PHY_SetMacReg(padapter, 0x34, BIT11, 1); */
|
|
||||||
rtw_write16(padapter, 0x34, rtw_read16(padapter, 0x34) | (BIT11));
|
|
||||||
rtw_write32(padapter, EFUSE_CTRL, 0x90600000 | ((addr << 8 | data)));
|
|
||||||
|
|
||||||
while ((0x80 & rtw_read8(padapter, EFUSE_CTRL + 3)) && (tmpidx < 100)) {
|
|
||||||
mdelay(1);
|
|
||||||
tmpidx++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tmpidx < 100)
|
|
||||||
bResult = true;
|
|
||||||
else
|
|
||||||
bResult = false;
|
|
||||||
|
|
||||||
/* disable Efuse program enable */
|
|
||||||
PHY_SetMacReg(padapter, EFUSE_TEST, BIT(11), 0);
|
|
||||||
|
|
||||||
return bResult;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------------
|
/*-----------------------------------------------------------------------------
|
||||||
* Function: Efuse_ReadAllMap
|
* Function: Efuse_ReadAllMap
|
||||||
*
|
*
|
||||||
|
|
@ -303,23 +160,17 @@ u8 efuse_OneByteWrite(struct adapter *padapter, u16 addr, u8 data, bool bPseudoT
|
||||||
* 11/11/2008 MHC Create Version 0.
|
* 11/11/2008 MHC Create Version 0.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void
|
static void Efuse_ReadAllMap(struct adapter *padapter, u8 efuseType, u8 *Efuse)
|
||||||
Efuse_ReadAllMap(
|
|
||||||
struct adapter *padapter,
|
|
||||||
u8 efuseType,
|
|
||||||
u8 *Efuse,
|
|
||||||
bool bPseudoTest);
|
|
||||||
void Efuse_ReadAllMap(struct adapter *padapter, u8 efuseType, u8 *Efuse, bool bPseudoTest)
|
|
||||||
{
|
{
|
||||||
u16 mapLen = 0;
|
u16 mapLen = 0;
|
||||||
|
|
||||||
Efuse_PowerSwitch(padapter, false, true);
|
Hal_EfusePowerSwitch(padapter, true);
|
||||||
|
|
||||||
EFUSE_GetEfuseDefinition(padapter, efuseType, TYPE_EFUSE_MAP_LEN, (void *)&mapLen, bPseudoTest);
|
Hal_GetEfuseDefinition(padapter, efuseType, TYPE_EFUSE_MAP_LEN, (void *)&mapLen);
|
||||||
|
|
||||||
efuse_ReadEFuse(padapter, efuseType, 0, mapLen, Efuse, bPseudoTest);
|
Hal_ReadEFuse(padapter, efuseType, 0, mapLen, Efuse);
|
||||||
|
|
||||||
Efuse_PowerSwitch(padapter, false, false);
|
Hal_EfusePowerSwitch(padapter, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------------
|
/*-----------------------------------------------------------------------------
|
||||||
|
|
@ -386,17 +237,17 @@ static void efuse_ShadowRead4Byte(struct adapter *padapter, u16 Offset, u32 *Val
|
||||||
* 11/13/2008 MHC Create Version 0.
|
* 11/13/2008 MHC Create Version 0.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void EFUSE_ShadowMapUpdate(struct adapter *padapter, u8 efuseType, bool bPseudoTest)
|
void EFUSE_ShadowMapUpdate(struct adapter *padapter, u8 efuseType)
|
||||||
{
|
{
|
||||||
struct eeprom_priv *pEEPROM = GET_EEPROM_EFUSE_PRIV(padapter);
|
struct eeprom_priv *pEEPROM = GET_EEPROM_EFUSE_PRIV(padapter);
|
||||||
u16 mapLen = 0;
|
u16 mapLen = 0;
|
||||||
|
|
||||||
EFUSE_GetEfuseDefinition(padapter, efuseType, TYPE_EFUSE_MAP_LEN, (void *)&mapLen, bPseudoTest);
|
Hal_GetEfuseDefinition(padapter, efuseType, TYPE_EFUSE_MAP_LEN, (void *)&mapLen);
|
||||||
|
|
||||||
if (pEEPROM->bautoload_fail_flag)
|
if (pEEPROM->bautoload_fail_flag)
|
||||||
memset(pEEPROM->efuse_eeprom_data, 0xFF, mapLen);
|
memset(pEEPROM->efuse_eeprom_data, 0xFF, mapLen);
|
||||||
else
|
else
|
||||||
Efuse_ReadAllMap(padapter, efuseType, pEEPROM->efuse_eeprom_data, bPseudoTest);
|
Efuse_ReadAllMap(padapter, efuseType, pEEPROM->efuse_eeprom_data);
|
||||||
|
|
||||||
/* PlatformMoveMemory((void *)&pHalData->EfuseMap[EFUSE_MODIFY_MAP][0], */
|
/* PlatformMoveMemory((void *)&pHalData->EfuseMap[EFUSE_MODIFY_MAP][0], */
|
||||||
/* void *)&pHalData->EfuseMap[EFUSE_INIT_MAP][0], mapLen); */
|
/* void *)&pHalData->EfuseMap[EFUSE_INIT_MAP][0], mapLen); */
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,36 @@
|
||||||
#include <hal_btcoex.h>
|
#include <hal_btcoex.h>
|
||||||
#include <linux/jiffies.h>
|
#include <linux/jiffies.h>
|
||||||
|
|
||||||
|
static void _dynamic_check_timer_handler(struct timer_list *t)
|
||||||
|
{
|
||||||
|
struct adapter *adapter =
|
||||||
|
timer_container_of(adapter, t, mlmepriv.dynamic_chk_timer);
|
||||||
|
|
||||||
|
rtw_dynamic_check_timer_handler(adapter);
|
||||||
|
|
||||||
|
_set_timer(&adapter->mlmepriv.dynamic_chk_timer, 2000);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void _rtw_set_scan_deny_timer_hdl(struct timer_list *t)
|
||||||
|
{
|
||||||
|
struct adapter *adapter =
|
||||||
|
timer_container_of(adapter, t, mlmepriv.set_scan_deny_timer);
|
||||||
|
|
||||||
|
rtw_clear_scan_deny(adapter);
|
||||||
|
}
|
||||||
|
|
||||||
|
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_handler, 0);
|
||||||
|
timer_setup(&pmlmepriv->set_scan_deny_timer,
|
||||||
|
_rtw_set_scan_deny_timer_hdl, 0);
|
||||||
|
}
|
||||||
|
|
||||||
int rtw_init_mlme_priv(struct adapter *padapter)
|
int rtw_init_mlme_priv(struct adapter *padapter)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
@ -170,7 +200,6 @@ void _rtw_free_network(struct mlme_priv *pmlmepriv, struct wlan_network *pnetwor
|
||||||
|
|
||||||
void _rtw_free_network_nolock(struct mlme_priv *pmlmepriv, struct wlan_network *pnetwork)
|
void _rtw_free_network_nolock(struct mlme_priv *pmlmepriv, struct wlan_network *pnetwork)
|
||||||
{
|
{
|
||||||
|
|
||||||
struct __queue *free_queue = &pmlmepriv->free_bss_pool;
|
struct __queue *free_queue = &pmlmepriv->free_bss_pool;
|
||||||
|
|
||||||
if (!pnetwork)
|
if (!pnetwork)
|
||||||
|
|
@ -225,11 +254,9 @@ void rtw_free_network_queue(struct adapter *padapter, u8 isfreeall)
|
||||||
|
|
||||||
phead = get_list_head(scanned_queue);
|
phead = get_list_head(scanned_queue);
|
||||||
list_for_each_safe(plist, tmp, phead) {
|
list_for_each_safe(plist, tmp, phead) {
|
||||||
|
|
||||||
pnetwork = list_entry(plist, struct wlan_network, list);
|
pnetwork = list_entry(plist, struct wlan_network, list);
|
||||||
|
|
||||||
_rtw_free_network(pmlmepriv, pnetwork, isfreeall);
|
_rtw_free_network(pmlmepriv, pnetwork, isfreeall);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
spin_unlock_bh(&scanned_queue->lock);
|
spin_unlock_bh(&scanned_queue->lock);
|
||||||
|
|
@ -318,7 +345,6 @@ int rtw_is_same_ibss(struct adapter *adapter, struct wlan_network *pnetwork)
|
||||||
ret = true;
|
ret = true;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline int is_same_ess(struct wlan_bssid_ex *a, struct wlan_bssid_ex *b)
|
inline int is_same_ess(struct wlan_bssid_ex *a, struct wlan_bssid_ex *b)
|
||||||
|
|
@ -348,7 +374,6 @@ int is_same_network(struct wlan_bssid_ex *src, struct wlan_bssid_ex *dst, u8 fea
|
||||||
(d_cap & WLAN_CAPABILITY_IBSS)) &&
|
(d_cap & WLAN_CAPABILITY_IBSS)) &&
|
||||||
((s_cap & WLAN_CAPABILITY_ESS) ==
|
((s_cap & WLAN_CAPABILITY_ESS) ==
|
||||||
(d_cap & WLAN_CAPABILITY_ESS));
|
(d_cap & WLAN_CAPABILITY_ESS));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct wlan_network *_rtw_find_same_network(struct __queue *scanned_queue, struct wlan_network *network)
|
struct wlan_network *_rtw_find_same_network(struct __queue *scanned_queue, struct wlan_network *network)
|
||||||
|
|
@ -380,7 +405,6 @@ struct wlan_network *rtw_get_oldest_wlan_network(struct __queue *scanned_queue)
|
||||||
phead = get_list_head(scanned_queue);
|
phead = get_list_head(scanned_queue);
|
||||||
|
|
||||||
list_for_each(plist, phead) {
|
list_for_each(plist, phead) {
|
||||||
|
|
||||||
pwlan = list_entry(plist, struct wlan_network, list);
|
pwlan = list_entry(plist, struct wlan_network, list);
|
||||||
|
|
||||||
if (!pwlan->fixed) {
|
if (!pwlan->fixed) {
|
||||||
|
|
@ -389,7 +413,6 @@ struct wlan_network *rtw_get_oldest_wlan_network(struct __queue *scanned_queue)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return oldest;
|
return oldest;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void update_network(struct wlan_bssid_ex *dst, struct wlan_bssid_ex *src,
|
void update_network(struct wlan_bssid_ex *dst, struct wlan_bssid_ex *src,
|
||||||
|
|
@ -424,7 +447,6 @@ void update_network(struct wlan_bssid_ex *dst, struct wlan_bssid_ex *src,
|
||||||
sq_final = dst->phy_info.signal_quality;
|
sq_final = dst->phy_info.signal_quality;
|
||||||
rssi_final = dst->rssi;
|
rssi_final = dst->rssi;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (update_ie) {
|
if (update_ie) {
|
||||||
|
|
@ -486,7 +508,6 @@ void rtw_update_scanned_network(struct adapter *adapter, struct wlan_bssid_ex *t
|
||||||
|
|
||||||
if (!oldest || time_after(oldest->last_scanned, pnetwork->last_scanned))
|
if (!oldest || time_after(oldest->last_scanned, pnetwork->last_scanned))
|
||||||
oldest = pnetwork;
|
oldest = pnetwork;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If we didn't find a match, then get a new network slot to initialize
|
/* If we didn't find a match, then get a new network slot to initialize
|
||||||
|
|
@ -530,7 +551,6 @@ void rtw_update_scanned_network(struct adapter *adapter, struct wlan_bssid_ex *t
|
||||||
pnetwork->network.phy_info.signal_quality = 0;
|
pnetwork->network.phy_info.signal_quality = 0;
|
||||||
|
|
||||||
list_add_tail(&pnetwork->list, &queue->queue);
|
list_add_tail(&pnetwork->list, &queue->queue);
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* we have an entry and we are going to update it. But this entry may
|
/* we have an entry and we are going to update it. But this entry may
|
||||||
|
|
@ -567,12 +587,14 @@ void rtw_add_network(struct adapter *adapter, struct wlan_bssid_ex *pnetwork)
|
||||||
rtw_update_scanned_network(adapter, pnetwork);
|
rtw_update_scanned_network(adapter, pnetwork);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* select the desired network based on the capability of the (i)bss. */
|
/* select the desired network based on the capability of the (i)bss.
|
||||||
/* check items: (1) security */
|
* check items:
|
||||||
/* (2) network_type */
|
* (1) security
|
||||||
/* (3) WMM */
|
* (2) network_type
|
||||||
/* (4) HT */
|
* (3) WMM
|
||||||
/* (5) others */
|
* (4) HT
|
||||||
|
* (5) others
|
||||||
|
*/
|
||||||
int rtw_is_desired_network(struct adapter *adapter, struct wlan_network *pnetwork);
|
int rtw_is_desired_network(struct adapter *adapter, struct wlan_network *pnetwork);
|
||||||
int rtw_is_desired_network(struct adapter *adapter, struct wlan_network *pnetwork)
|
int rtw_is_desired_network(struct adapter *adapter, struct wlan_network *pnetwork)
|
||||||
{
|
{
|
||||||
|
|
@ -591,7 +613,6 @@ int rtw_is_desired_network(struct adapter *adapter, struct wlan_network *pnetwor
|
||||||
return true;
|
return true;
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
if (adapter->registrypriv.wifi_spec == 1) { /* for correct flow of 8021X to do.... */
|
if (adapter->registrypriv.wifi_spec == 1) { /* for correct flow of 8021X to do.... */
|
||||||
u8 *p = NULL;
|
u8 *p = NULL;
|
||||||
|
|
@ -868,15 +889,23 @@ void rtw_indicate_connect(struct adapter *padapter)
|
||||||
pmlmepriv->to_join = false;
|
pmlmepriv->to_join = false;
|
||||||
|
|
||||||
if (!check_fwstate(&padapter->mlmepriv, _FW_LINKED)) {
|
if (!check_fwstate(&padapter->mlmepriv, _FW_LINKED)) {
|
||||||
|
|
||||||
set_fwstate(pmlmepriv, _FW_LINKED);
|
set_fwstate(pmlmepriv, _FW_LINKED);
|
||||||
|
|
||||||
rtw_os_indicate_connect(padapter);
|
if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) ||
|
||||||
|
check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) {
|
||||||
|
rtw_cfg80211_ibss_indicate_connect(padapter);
|
||||||
|
} else {
|
||||||
|
rtw_cfg80211_indicate_connect(padapter);
|
||||||
|
}
|
||||||
|
|
||||||
|
netif_carrier_on(padapter->pnetdev);
|
||||||
|
|
||||||
|
if (padapter->pid[2] != 0)
|
||||||
|
rtw_signal_process(padapter->pid[2], SIGALRM);
|
||||||
}
|
}
|
||||||
|
|
||||||
rtw_set_to_roam(padapter, 0);
|
rtw_set_to_roam(padapter, 0);
|
||||||
rtw_set_scan_deny(padapter, 3000);
|
rtw_set_scan_deny(padapter, 3000);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -891,10 +920,14 @@ void rtw_indicate_disconnect(struct adapter *padapter)
|
||||||
if (rtw_to_roam(padapter) > 0)
|
if (rtw_to_roam(padapter) > 0)
|
||||||
_clr_fwstate_(pmlmepriv, _FW_LINKED);
|
_clr_fwstate_(pmlmepriv, _FW_LINKED);
|
||||||
|
|
||||||
if (check_fwstate(&padapter->mlmepriv, _FW_LINKED)
|
if (check_fwstate(&padapter->mlmepriv, _FW_LINKED) || rtw_to_roam(padapter) <= 0) {
|
||||||
|| (rtw_to_roam(padapter) <= 0)
|
/* Do it first for tx broadcast pkt after disconnection issue! */
|
||||||
) {
|
netif_carrier_off(padapter->pnetdev);
|
||||||
rtw_os_indicate_disconnect(padapter);
|
|
||||||
|
rtw_cfg80211_indicate_disconnect(padapter);
|
||||||
|
|
||||||
|
/* modify for CONFIG_IEEE80211W, none 11w also can use the same command */
|
||||||
|
rtw_reset_securitypriv_cmd(padapter);
|
||||||
|
|
||||||
/* set ips_deny_time to avoid enter IPS before LPS leave */
|
/* set ips_deny_time to avoid enter IPS before LPS leave */
|
||||||
rtw_set_ips_deny(padapter, 3000);
|
rtw_set_ips_deny(padapter, 3000);
|
||||||
|
|
@ -909,7 +942,7 @@ 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, bool aborted)
|
||||||
{
|
{
|
||||||
rtw_os_indicate_scan_done(padapter, aborted);
|
rtw_cfg80211_indicate_scan_done(padapter, aborted);
|
||||||
|
|
||||||
if ((!adapter_to_pwrctl(padapter)->bInSuspend) &&
|
if ((!adapter_to_pwrctl(padapter)->bInSuspend) &&
|
||||||
(!check_fwstate(&padapter->mlmepriv,
|
(!check_fwstate(&padapter->mlmepriv,
|
||||||
|
|
@ -929,7 +962,6 @@ void rtw_scan_abort(struct adapter *adapter)
|
||||||
pmlmeext->scan_abort = true;
|
pmlmeext->scan_abort = true;
|
||||||
while (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY)
|
while (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY)
|
||||||
&& jiffies_to_msecs(start) <= 200) {
|
&& jiffies_to_msecs(start) <= 200) {
|
||||||
|
|
||||||
if (adapter->bDriverStopped || adapter->bSurpriseRemoved)
|
if (adapter->bDriverStopped || adapter->bSurpriseRemoved)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
@ -1022,7 +1054,6 @@ static struct sta_info *rtw_joinbss_update_stainfo(struct adapter *padapter, str
|
||||||
}
|
}
|
||||||
|
|
||||||
return psta;
|
return psta;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* pnetwork : returns from rtw_joinbss_event_callback */
|
/* pnetwork : returns from rtw_joinbss_event_callback */
|
||||||
|
|
@ -1073,6 +1104,66 @@ static void rtw_joinbss_update_network(struct adapter *padapter, struct wlan_net
|
||||||
rtw_update_ht_cap(padapter, cur_network->network.ies, cur_network->network.ie_length, (u8) cur_network->network.configuration.ds_config);
|
rtw_update_ht_cap(padapter, cur_network->network.ies, cur_network->network.ie_length, (u8) cur_network->network.configuration.ds_config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static struct rt_pmkid_list backupPMKIDList[NUM_PMKID_CACHE];
|
||||||
|
void rtw_reset_securitypriv(struct adapter *adapter)
|
||||||
|
{
|
||||||
|
u8 backupPMKIDIndex = 0;
|
||||||
|
u8 backupTKIPCountermeasure = 0x00;
|
||||||
|
u32 backupTKIPcountermeasure_time = 0;
|
||||||
|
/* add for CONFIG_IEEE80211W, none 11w also can use */
|
||||||
|
struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv;
|
||||||
|
|
||||||
|
spin_lock_bh(&adapter->security_key_mutex);
|
||||||
|
|
||||||
|
if (adapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X) {
|
||||||
|
/* 802.1x */
|
||||||
|
/* Added by Albert 2009/02/18 */
|
||||||
|
/* 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(&backupPMKIDList[0], &adapter->securitypriv.PMKIDList[0], sizeof(struct rt_pmkid_list) * NUM_PMKID_CACHE);
|
||||||
|
backupPMKIDIndex = adapter->securitypriv.PMKIDIndex;
|
||||||
|
backupTKIPCountermeasure = adapter->securitypriv.btkip_countermeasure;
|
||||||
|
backupTKIPcountermeasure_time = adapter->securitypriv.btkip_countermeasure_time;
|
||||||
|
|
||||||
|
/* reset RX BIP packet number */
|
||||||
|
pmlmeext->mgnt_80211w_IPN_rx = 0;
|
||||||
|
|
||||||
|
memset((unsigned char *)&adapter->securitypriv, 0, sizeof(struct security_priv));
|
||||||
|
|
||||||
|
/* Added by Albert 2009/02/18 */
|
||||||
|
/* Restore the PMK information to securitypriv structure for the following connection. */
|
||||||
|
memcpy(&adapter->securitypriv.PMKIDList[0], &backupPMKIDList[0], sizeof(struct rt_pmkid_list) * NUM_PMKID_CACHE);
|
||||||
|
adapter->securitypriv.PMKIDIndex = backupPMKIDIndex;
|
||||||
|
adapter->securitypriv.btkip_countermeasure = backupTKIPCountermeasure;
|
||||||
|
adapter->securitypriv.btkip_countermeasure_time = backupTKIPcountermeasure_time;
|
||||||
|
|
||||||
|
adapter->securitypriv.ndisauthtype = Ndis802_11AuthModeOpen;
|
||||||
|
adapter->securitypriv.ndisencryptstatus = Ndis802_11WEPDisabled;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
/* reset values in securitypriv */
|
||||||
|
/* if (adapter->mlmepriv.fw_state & WIFI_STATION_STATE) */
|
||||||
|
/* */
|
||||||
|
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;
|
||||||
|
/* */
|
||||||
|
}
|
||||||
|
/* add for CONFIG_IEEE80211W, none 11w also can use */
|
||||||
|
spin_unlock_bh(&adapter->security_key_mutex);
|
||||||
|
}
|
||||||
|
|
||||||
/* Notes: the function could be > passive_level (the same context as Rx tasklet) */
|
/* Notes: the function could be > passive_level (the same context as Rx tasklet) */
|
||||||
/* pnetwork : returns from rtw_joinbss_event_callback */
|
/* pnetwork : returns from rtw_joinbss_event_callback */
|
||||||
/* ptarget_wlan: found from scanned_queue */
|
/* ptarget_wlan: found from scanned_queue */
|
||||||
|
|
@ -1397,11 +1488,11 @@ void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf)
|
||||||
|
|
||||||
if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) ||
|
if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) ||
|
||||||
check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) {
|
check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) {
|
||||||
|
|
||||||
rtw_free_stainfo(adapter, psta);
|
rtw_free_stainfo(adapter, psta);
|
||||||
|
|
||||||
if (adapter->stapriv.asoc_sta_count == 1) {/* a sta + bc/mc_stainfo (not Ibss_stainfo) */
|
if (adapter->stapriv.asoc_sta_count == 1) {/* a sta + bc/mc_stainfo (not Ibss_stainfo) */
|
||||||
u8 ret = _SUCCESS;
|
u8 ret = _SUCCESS;
|
||||||
|
|
||||||
spin_lock_bh(&pmlmepriv->scanned_queue.lock);
|
spin_lock_bh(&pmlmepriv->scanned_queue.lock);
|
||||||
/* free old ibss network */
|
/* free old ibss network */
|
||||||
pwlan = rtw_find_network(&pmlmepriv->scanned_queue, tgt_network->network.mac_address);
|
pwlan = rtw_find_network(&pmlmepriv->scanned_queue, tgt_network->network.mac_address);
|
||||||
|
|
@ -1431,7 +1522,6 @@ void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf)
|
||||||
if (ret != _SUCCESS)
|
if (ret != _SUCCESS)
|
||||||
goto unlock;
|
goto unlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
unlock:
|
unlock:
|
||||||
|
|
@ -1490,7 +1580,6 @@ void _rtw_join_timeout_handler(struct timer_list *t)
|
||||||
|
|
||||||
/* indicate disconnect for the case that join_timeout and check_fwstate != FW_LINKED */
|
/* indicate disconnect for the case that join_timeout and check_fwstate != FW_LINKED */
|
||||||
rtw_cfg80211_indicate_disconnect(adapter);
|
rtw_cfg80211_indicate_disconnect(adapter);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
spin_unlock_bh(&pmlmepriv->lock);
|
spin_unlock_bh(&pmlmepriv->lock);
|
||||||
|
|
@ -1540,7 +1629,6 @@ static void rtw_auto_scan_handler(struct adapter *padapter)
|
||||||
|
|
||||||
if (pmlmepriv->auto_scan_int_ms != 0
|
if (pmlmepriv->auto_scan_int_ms != 0
|
||||||
&& jiffies_to_msecs(jiffies - pmlmepriv->scan_start_time) > pmlmepriv->auto_scan_int_ms) {
|
&& jiffies_to_msecs(jiffies - pmlmepriv->scan_start_time) > pmlmepriv->auto_scan_int_ms) {
|
||||||
|
|
||||||
if (!padapter->registrypriv.wifi_spec) {
|
if (!padapter->registrypriv.wifi_spec) {
|
||||||
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY | _FW_UNDER_LINKING) == true)
|
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY | _FW_UNDER_LINKING) == true)
|
||||||
goto exit;
|
goto exit;
|
||||||
|
|
@ -1673,12 +1761,10 @@ int rtw_select_roaming_candidate(struct mlme_priv *mlme)
|
||||||
phead = get_list_head(queue);
|
phead = get_list_head(queue);
|
||||||
|
|
||||||
list_for_each(mlme->pscanned, phead) {
|
list_for_each(mlme->pscanned, phead) {
|
||||||
|
|
||||||
pnetwork = list_entry(mlme->pscanned, struct wlan_network,
|
pnetwork = list_entry(mlme->pscanned, struct wlan_network,
|
||||||
list);
|
list);
|
||||||
|
|
||||||
rtw_check_roaming_candidate(mlme, &candidate, pnetwork);
|
rtw_check_roaming_candidate(mlme, &candidate, pnetwork);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!candidate) {
|
if (!candidate) {
|
||||||
|
|
@ -1770,12 +1856,10 @@ int rtw_select_and_join_from_scanned_queue(struct mlme_priv *pmlmepriv)
|
||||||
|
|
||||||
phead = get_list_head(queue);
|
phead = get_list_head(queue);
|
||||||
list_for_each(pmlmepriv->pscanned, phead) {
|
list_for_each(pmlmepriv->pscanned, phead) {
|
||||||
|
|
||||||
pnetwork = list_entry(pmlmepriv->pscanned,
|
pnetwork = list_entry(pmlmepriv->pscanned,
|
||||||
struct wlan_network, list);
|
struct wlan_network, list);
|
||||||
|
|
||||||
rtw_check_join_candidate(pmlmepriv, &candidate, pnetwork);
|
rtw_check_join_candidate(pmlmepriv, &candidate, pnetwork);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!candidate) {
|
if (!candidate) {
|
||||||
|
|
@ -1863,7 +1947,6 @@ signed int rtw_set_key(struct adapter *adapter, struct security_priv *psecurityp
|
||||||
adapter->securitypriv.key_mask |= BIT(psetkeyparm->keyid);
|
adapter->securitypriv.key_mask |= BIT(psetkeyparm->keyid);
|
||||||
|
|
||||||
switch (psetkeyparm->algorithm) {
|
switch (psetkeyparm->algorithm) {
|
||||||
|
|
||||||
case _WEP40_:
|
case _WEP40_:
|
||||||
keylen = 5;
|
keylen = 5;
|
||||||
memcpy(&psetkeyparm->key[0], &psecuritypriv->dot11DefKey[keyid].skey[0], keylen);
|
memcpy(&psetkeyparm->key[0], &psecuritypriv->dot11DefKey[keyid].skey[0], keylen);
|
||||||
|
|
@ -1939,20 +2022,18 @@ int rtw_restruct_wmm_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, uint in_
|
||||||
}
|
}
|
||||||
|
|
||||||
return ielength;
|
return ielength;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* */
|
/* Ported from 8185: IsInPreAuthKeyList().
|
||||||
/* Ported from 8185: IsInPreAuthKeyList(). (Renamed from SecIsInPreAuthKeyList(), 2006-10-13.) */
|
* (Renamed from SecIsInPreAuthKeyList(), 2006-10-13.)
|
||||||
/* Added by Annie, 2006-05-07. */
|
* Added by Annie, 2006-05-07.
|
||||||
/* */
|
*
|
||||||
/* Search by BSSID, */
|
* Search by BSSID,
|
||||||
/* Return Value: */
|
*
|
||||||
/* -1 :if there is no pre-auth key in the table */
|
* Return Value:
|
||||||
/* >= 0 :if there is pre-auth key, and return the entry id */
|
* -1: if there is no pre-auth key in the table
|
||||||
/* */
|
* >=0: if there is pre-auth key, and return the entry id
|
||||||
/* */
|
*/
|
||||||
|
|
||||||
static int SecIsInPMKIDList(struct adapter *Adapter, u8 *bssid)
|
static int SecIsInPMKIDList(struct adapter *Adapter, u8 *bssid)
|
||||||
{
|
{
|
||||||
struct security_priv *p = &Adapter->securitypriv;
|
struct security_priv *p = &Adapter->securitypriv;
|
||||||
|
|
@ -1990,6 +2071,40 @@ static int rtw_append_pmkid(struct adapter *Adapter, int iEntry, u8 *ie, uint ie
|
||||||
return ie_len;
|
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 == WLAN_EID_VENDOR_SPECIFIC) {
|
||||||
|
buff = rtw_zmalloc(IW_CUSTOM_MAX);
|
||||||
|
if (!buff)
|
||||||
|
return;
|
||||||
|
|
||||||
|
p = buff;
|
||||||
|
|
||||||
|
p += scnprintf(p, IW_CUSTOM_MAX - (p - buff), "ASSOCINFO(ReqIEs =");
|
||||||
|
|
||||||
|
len = sec_ie[1] + 2;
|
||||||
|
len = (len < IW_CUSTOM_MAX) ? len : IW_CUSTOM_MAX;
|
||||||
|
|
||||||
|
for (i = 0; i < len; i++)
|
||||||
|
p += scnprintf(p, IW_CUSTOM_MAX - (p - buff), "%02x", sec_ie[i]);
|
||||||
|
|
||||||
|
p += scnprintf(p, IW_CUSTOM_MAX - (p - buff), ")");
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
kfree(buff);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
signed int rtw_restruct_sec_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, uint in_len)
|
signed int rtw_restruct_sec_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, uint in_len)
|
||||||
{
|
{
|
||||||
u8 authmode = 0x0;
|
u8 authmode = 0x0;
|
||||||
|
|
@ -2311,7 +2426,6 @@ unsigned int rtw_restructure_ht_ie(struct adapter *padapter, u8 *in_ie, u8 *out_
|
||||||
}
|
}
|
||||||
|
|
||||||
return phtpriv->ht_option;
|
return phtpriv->ht_option;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* the function is > passive_level (in critical_section) */
|
/* the function is > passive_level (in critical_section) */
|
||||||
|
|
@ -2346,7 +2460,6 @@ void rtw_update_ht_cap(struct adapter *padapter, u8 *pie, uint ie_len, u8 channe
|
||||||
max_ampdu_sz = 1 << (max_ampdu_sz+3); /* max_ampdu_sz (kbytes); */
|
max_ampdu_sz = 1 << (max_ampdu_sz+3); /* max_ampdu_sz (kbytes); */
|
||||||
|
|
||||||
phtpriv->rx_ampdu_maxlen = max_ampdu_sz;
|
phtpriv->rx_ampdu_maxlen = max_ampdu_sz;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
len = 0;
|
len = 0;
|
||||||
|
|
@ -2437,7 +2550,6 @@ void rtw_issue_addbareq_cmd(struct adapter *padapter, struct xmit_frame *pxmitfr
|
||||||
rtw_addbareq_cmd(padapter, (u8) priority, pattrib->ra);
|
rtw_addbareq_cmd(padapter, (u8) priority, pattrib->ra);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void rtw_append_exented_cap(struct adapter *padapter, u8 *out_ie, uint *pout_len)
|
void rtw_append_exented_cap(struct adapter *padapter, u8 *out_ie, uint *pout_len)
|
||||||
|
|
@ -2478,6 +2590,7 @@ void rtw_roaming(struct adapter *padapter, struct wlan_network *tgt_network)
|
||||||
_rtw_roaming(padapter, tgt_network);
|
_rtw_roaming(padapter, tgt_network);
|
||||||
spin_unlock_bh(&pmlmepriv->lock);
|
spin_unlock_bh(&pmlmepriv->lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
void _rtw_roaming(struct adapter *padapter, struct wlan_network *tgt_network)
|
void _rtw_roaming(struct adapter *padapter, struct wlan_network *tgt_network)
|
||||||
{
|
{
|
||||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||||
|
|
|
||||||
|
|
@ -374,6 +374,15 @@ static u8 init_channel_set(struct adapter *padapter, u8 ChannelPlan, struct rt_c
|
||||||
return chanset_size;
|
return chanset_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
timer_setup(&pmlmeext->sa_query_timer, sa_query_timer_hdl, 0);
|
||||||
|
}
|
||||||
|
|
||||||
void init_mlme_ext_priv(struct adapter *padapter)
|
void init_mlme_ext_priv(struct adapter *padapter)
|
||||||
{
|
{
|
||||||
struct registry_priv *pregistrypriv = &padapter->registrypriv;
|
struct registry_priv *pregistrypriv = &padapter->registrypriv;
|
||||||
|
|
@ -1122,9 +1131,6 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame)
|
||||||
if (!wpa_ie) {
|
if (!wpa_ie) {
|
||||||
if (elems.wps_ie) {
|
if (elems.wps_ie) {
|
||||||
pstat->flags |= WLAN_STA_WPS;
|
pstat->flags |= WLAN_STA_WPS;
|
||||||
/* wpabuf_free(sta->wps_ie); */
|
|
||||||
/* sta->wps_ie = wpabuf_alloc_copy(elems.wps_ie + 4, */
|
|
||||||
/* elems.wps_ie_len - 4); */
|
|
||||||
} else {
|
} else {
|
||||||
pstat->flags |= WLAN_STA_MAYBE_WPS;
|
pstat->flags |= WLAN_STA_MAYBE_WPS;
|
||||||
}
|
}
|
||||||
|
|
@ -1502,11 +1508,12 @@ unsigned int OnDeAuth(struct adapter *padapter, union recv_frame *precv_frame)
|
||||||
return _SUCCESS;
|
return _SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Commented by Albert 20130604 */
|
/* Commented by Albert 20130604
|
||||||
/* Before sending the auth frame to start the STA/GC mode connection with AP/GO, */
|
* Before sending the auth frame to start the STA/GC mode connection with AP/GO,
|
||||||
/* we will send the deauth first. */
|
* we will send the deauth first.
|
||||||
/* However, the Win8.1 with BRCM Wi-Fi will send the deauth with reason code 6 to us after receieving our deauth. */
|
* However, the Win8.1 with BRCM Wi-Fi will send the deauth with reason code 6 to us after receieving our deauth.
|
||||||
/* Added the following code to avoid this case. */
|
* Added the following code to avoid this case.
|
||||||
|
*/
|
||||||
if ((pmlmeinfo->state & WIFI_FW_AUTH_STATE) ||
|
if ((pmlmeinfo->state & WIFI_FW_AUTH_STATE) ||
|
||||||
(pmlmeinfo->state & WIFI_FW_ASSOC_STATE)) {
|
(pmlmeinfo->state & WIFI_FW_ASSOC_STATE)) {
|
||||||
if (reason == WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA) {
|
if (reason == WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA) {
|
||||||
|
|
@ -4144,12 +4151,13 @@ void start_clnt_join(struct adapter *padapter)
|
||||||
|
|
||||||
rtw_hal_set_hwreg(padapter, HW_VAR_SEC_CFG, (u8 *)(&val8));
|
rtw_hal_set_hwreg(padapter, HW_VAR_SEC_CFG, (u8 *)(&val8));
|
||||||
|
|
||||||
/* Because of AP's not receiving deauth before */
|
/* Because of AP's not receiving deauth before
|
||||||
/* AP may: 1)not response auth or 2)deauth us after link is complete */
|
* AP may: 1)not response auth or 2)deauth us after link is complete
|
||||||
/* issue deauth before issuing auth to deal with the situation */
|
* issue deauth before issuing auth to deal with the situation
|
||||||
|
*
|
||||||
/* Commented by Albert 2012/07/21 */
|
* Commented by Albert 2012/07/21
|
||||||
/* For the Win8 P2P connection, it will be hard to have a successful connection if this Wi-Fi doesn't connect to it. */
|
* For the Win8 P2P connection, it will be hard to have a successful connection if this Wi-Fi doesn't connect to it.
|
||||||
|
*/
|
||||||
{
|
{
|
||||||
/* To avoid connecting to AP fail during resume process, change retry count from 5 to 1 */
|
/* To avoid connecting to AP fail during resume process, change retry count from 5 to 1 */
|
||||||
issue_deauth_ex(padapter, pnetwork->mac_address, WLAN_REASON_DEAUTH_LEAVING, 1, 100);
|
issue_deauth_ex(padapter, pnetwork->mac_address, WLAN_REASON_DEAUTH_LEAVING, 1, 100);
|
||||||
|
|
@ -4322,7 +4330,6 @@ static void process_80211d(struct adapter *padapter, struct wlan_bssid_ex *bssid
|
||||||
k++;
|
k++;
|
||||||
} else if (chplan_sta[i].ChannelNum < chplan_ap.Channel[j]) {
|
} else if (chplan_sta[i].ChannelNum < chplan_ap.Channel[j]) {
|
||||||
chplan_new[k].ChannelNum = chplan_sta[i].ChannelNum;
|
chplan_new[k].ChannelNum = chplan_sta[i].ChannelNum;
|
||||||
/* chplan_new[k].ScanType = chplan_sta[i].ScanType; */
|
|
||||||
chplan_new[k].ScanType = SCAN_PASSIVE;
|
chplan_new[k].ScanType = SCAN_PASSIVE;
|
||||||
i++;
|
i++;
|
||||||
k++;
|
k++;
|
||||||
|
|
@ -4340,7 +4347,6 @@ static void process_80211d(struct adapter *padapter, struct wlan_bssid_ex *bssid
|
||||||
(chplan_sta[i].ChannelNum <= 14)) {
|
(chplan_sta[i].ChannelNum <= 14)) {
|
||||||
|
|
||||||
chplan_new[k].ChannelNum = chplan_sta[i].ChannelNum;
|
chplan_new[k].ChannelNum = chplan_sta[i].ChannelNum;
|
||||||
/* chplan_new[k].ScanType = chplan_sta[i].ScanType; */
|
|
||||||
chplan_new[k].ScanType = SCAN_PASSIVE;
|
chplan_new[k].ScanType = SCAN_PASSIVE;
|
||||||
i++;
|
i++;
|
||||||
k++;
|
k++;
|
||||||
|
|
@ -5124,12 +5130,8 @@ void link_timer_hdl(struct timer_list *t)
|
||||||
{
|
{
|
||||||
struct adapter *padapter =
|
struct adapter *padapter =
|
||||||
timer_container_of(padapter, t, mlmeextpriv.link_timer);
|
timer_container_of(padapter, t, mlmeextpriv.link_timer);
|
||||||
/* static unsigned int rx_pkt = 0; */
|
|
||||||
/* static u64 tx_cnt = 0; */
|
|
||||||
/* struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); */
|
|
||||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||||
/* struct sta_priv *pstapriv = &padapter->stapriv; */
|
|
||||||
|
|
||||||
|
|
||||||
if (pmlmeinfo->state & WIFI_FW_AUTH_NULL) {
|
if (pmlmeinfo->state & WIFI_FW_AUTH_NULL) {
|
||||||
|
|
|
||||||
|
|
@ -430,10 +430,7 @@ s32 LPS_RF_ON_check(struct adapter *padapter, u32 delay_ms)
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* */
|
/* Description: Enter the leisure power save mode. */
|
||||||
/* Description: */
|
|
||||||
/* Enter the leisure power save mode. */
|
|
||||||
/* */
|
|
||||||
void LPS_Enter(struct adapter *padapter, const char *msg)
|
void LPS_Enter(struct adapter *padapter, const char *msg)
|
||||||
{
|
{
|
||||||
struct dvobj_priv *dvobj = adapter_to_dvobj(padapter);
|
struct dvobj_priv *dvobj = adapter_to_dvobj(padapter);
|
||||||
|
|
@ -466,10 +463,7 @@ void LPS_Enter(struct adapter *padapter, const char *msg)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* */
|
/* Description: Leave the leisure power save mode. */
|
||||||
/* Description: */
|
|
||||||
/* Leave the leisure power save mode. */
|
|
||||||
/* */
|
|
||||||
void LPS_Leave(struct adapter *padapter, const char *msg)
|
void LPS_Leave(struct adapter *padapter, const char *msg)
|
||||||
{
|
{
|
||||||
#define LPS_LEAVE_TIMEOUT_MS 100
|
#define LPS_LEAVE_TIMEOUT_MS 100
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,8 @@ signed int _rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *pada
|
||||||
|
|
||||||
list_add_tail(&(precvframe->u.list), &(precvpriv->free_recv_queue.queue));
|
list_add_tail(&(precvframe->u.list), &(precvpriv->free_recv_queue.queue));
|
||||||
|
|
||||||
rtw_os_recv_resource_alloc(padapter, precvframe);
|
precvframe->u.hdr.pkt_newalloc = NULL;
|
||||||
|
precvframe->u.hdr.pkt = NULL;
|
||||||
|
|
||||||
precvframe->u.hdr.len = 0;
|
precvframe->u.hdr.len = 0;
|
||||||
|
|
||||||
|
|
@ -90,11 +91,22 @@ signed int _rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *pada
|
||||||
|
|
||||||
void _rtw_free_recv_priv(struct recv_priv *precvpriv)
|
void _rtw_free_recv_priv(struct recv_priv *precvpriv)
|
||||||
{
|
{
|
||||||
|
signed int i;
|
||||||
|
union recv_frame *precvframe;
|
||||||
struct adapter *padapter = precvpriv->adapter;
|
struct adapter *padapter = precvpriv->adapter;
|
||||||
|
|
||||||
rtw_free_uc_swdec_pending_queue(padapter);
|
rtw_free_uc_swdec_pending_queue(padapter);
|
||||||
|
|
||||||
rtw_os_recv_resource_free(precvpriv);
|
precvframe = (union recv_frame *)precvpriv->precv_frame_buf;
|
||||||
|
|
||||||
|
for (i = 0; i < NR_RECVFRAME; i++) {
|
||||||
|
if (precvframe->u.hdr.pkt) {
|
||||||
|
/* free skb by driver */
|
||||||
|
dev_kfree_skb_any(precvframe->u.hdr.pkt);
|
||||||
|
precvframe->u.hdr.pkt = NULL;
|
||||||
|
}
|
||||||
|
precvframe++;
|
||||||
|
}
|
||||||
|
|
||||||
vfree(precvpriv->pallocated_frame_buf);
|
vfree(precvpriv->pallocated_frame_buf);
|
||||||
|
|
||||||
|
|
@ -147,8 +159,10 @@ int rtw_free_recvframe(union recv_frame *precvframe, struct __queue *pfree_recv_
|
||||||
struct adapter *padapter = precvframe->u.hdr.adapter;
|
struct adapter *padapter = precvframe->u.hdr.adapter;
|
||||||
struct recv_priv *precvpriv = &padapter->recvpriv;
|
struct recv_priv *precvpriv = &padapter->recvpriv;
|
||||||
|
|
||||||
rtw_os_free_recvframe(precvframe);
|
if (precvframe->u.hdr.pkt) {
|
||||||
|
dev_kfree_skb_any(precvframe->u.hdr.pkt);/* free skb by driver */
|
||||||
|
precvframe->u.hdr.pkt = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
spin_lock_bh(&pfree_recv_queue->lock);
|
spin_lock_bh(&pfree_recv_queue->lock);
|
||||||
|
|
||||||
|
|
@ -294,6 +308,50 @@ struct recv_buf *rtw_dequeue_recvbuf(struct __queue *queue)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void rtw_handle_tkip_mic_err(struct adapter *padapter, u8 bgroup)
|
||||||
|
{
|
||||||
|
enum nl80211_key_type key_type = 0;
|
||||||
|
union iwreq_data wrqu;
|
||||||
|
struct iw_michaelmicfailure ev;
|
||||||
|
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||||
|
struct security_priv *psecuritypriv = &padapter->securitypriv;
|
||||||
|
unsigned long 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bgroup)
|
||||||
|
key_type |= NL80211_KEYTYPE_GROUP;
|
||||||
|
else
|
||||||
|
key_type |= NL80211_KEYTYPE_PAIRWISE;
|
||||||
|
|
||||||
|
cfg80211_michael_mic_failure(padapter->pnetdev, (u8 *)&pmlmepriv->assoc_bssid[0], key_type, -1,
|
||||||
|
NULL, GFP_ATOMIC);
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
static signed int recvframe_chkmic(struct adapter *adapter, union recv_frame *precvframe)
|
static signed int recvframe_chkmic(struct adapter *adapter, union recv_frame *precvframe)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
@ -1564,6 +1622,93 @@ static signed int wlanhdr_to_ethhdr(union recv_frame *precvframe)
|
||||||
return _SUCCESS;
|
return _SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static struct sk_buff *rtw_alloc_msdu_pkt(union recv_frame *prframe, u16 nSubframe_Length, u8 *pdata)
|
||||||
|
{
|
||||||
|
u16 eth_type;
|
||||||
|
struct sk_buff *sub_skb;
|
||||||
|
struct rx_pkt_attrib *pattrib;
|
||||||
|
|
||||||
|
pattrib = &prframe->u.hdr.attrib;
|
||||||
|
|
||||||
|
sub_skb = rtw_skb_alloc(nSubframe_Length + 12);
|
||||||
|
if (!sub_skb)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
skb_reserve(sub_skb, 12);
|
||||||
|
skb_put_data(sub_skb, (pdata + ETH_HLEN), nSubframe_Length);
|
||||||
|
|
||||||
|
eth_type = get_unaligned_be16(&sub_skb->data[6]);
|
||||||
|
|
||||||
|
if (sub_skb->len >= 8 &&
|
||||||
|
((!memcmp(sub_skb->data, rfc1042_header, SNAP_SIZE) &&
|
||||||
|
eth_type != ETH_P_AARP && eth_type != ETH_P_IPX) ||
|
||||||
|
!memcmp(sub_skb->data, bridge_tunnel_header, SNAP_SIZE))) {
|
||||||
|
/*
|
||||||
|
* remove RFC1042 or Bridge-Tunnel encapsulation and replace
|
||||||
|
* EtherType
|
||||||
|
*/
|
||||||
|
skb_pull(sub_skb, SNAP_SIZE);
|
||||||
|
memcpy(skb_push(sub_skb, ETH_ALEN), pattrib->src, ETH_ALEN);
|
||||||
|
memcpy(skb_push(sub_skb, ETH_ALEN), pattrib->dst, ETH_ALEN);
|
||||||
|
} else {
|
||||||
|
__be16 len;
|
||||||
|
/* Leave Ethernet header part of hdr and full payload */
|
||||||
|
len = htons(sub_skb->len);
|
||||||
|
memcpy(skb_push(sub_skb, 2), &len, 2);
|
||||||
|
memcpy(skb_push(sub_skb, ETH_ALEN), pattrib->src, ETH_ALEN);
|
||||||
|
memcpy(skb_push(sub_skb, ETH_ALEN), pattrib->dst, ETH_ALEN);
|
||||||
|
}
|
||||||
|
|
||||||
|
return sub_skb;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void rtw_recv_indicate_pkt(struct adapter *padapter, struct sk_buff *pkt, struct rx_pkt_attrib *pattrib)
|
||||||
|
{
|
||||||
|
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||||
|
|
||||||
|
/* Indicate the packets to upper layer */
|
||||||
|
if (pkt) {
|
||||||
|
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) {
|
||||||
|
struct sk_buff *pskb2 = NULL;
|
||||||
|
struct sta_info *psta = NULL;
|
||||||
|
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||||
|
int 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(pkt, GFP_ATOMIC);
|
||||||
|
} else {
|
||||||
|
psta = rtw_get_stainfo(pstapriv, pattrib->dst);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (psta) {
|
||||||
|
struct net_device *pnetdev = (struct net_device *)padapter->pnetdev;
|
||||||
|
/* skb->ip_summed = CHECKSUM_NONE; */
|
||||||
|
pkt->dev = pnetdev;
|
||||||
|
skb_set_queue_mapping(pkt, rtw_recv_select_queue(pkt));
|
||||||
|
|
||||||
|
_rtw_xmit_entry(pkt, pnetdev);
|
||||||
|
|
||||||
|
if (bmcast && pskb2)
|
||||||
|
pkt = pskb2;
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
/* to APself */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pkt->protocol = eth_type_trans(pkt, padapter->pnetdev);
|
||||||
|
pkt->dev = padapter->pnetdev;
|
||||||
|
|
||||||
|
pkt->ip_summed = CHECKSUM_NONE;
|
||||||
|
|
||||||
|
rtw_netif_rx(padapter->pnetdev, pkt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static int amsdu_to_msdu(struct adapter *padapter, union recv_frame *prframe)
|
static int amsdu_to_msdu(struct adapter *padapter, union recv_frame *prframe)
|
||||||
{
|
{
|
||||||
int a_len, padding_len;
|
int a_len, padding_len;
|
||||||
|
|
@ -1593,7 +1738,7 @@ static int amsdu_to_msdu(struct adapter *padapter, union recv_frame *prframe)
|
||||||
if (a_len < ETH_HLEN + nSubframe_Length)
|
if (a_len < ETH_HLEN + nSubframe_Length)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
sub_pkt = rtw_os_alloc_msdu_pkt(prframe, nSubframe_Length, pdata);
|
sub_pkt = rtw_alloc_msdu_pkt(prframe, nSubframe_Length, pdata);
|
||||||
if (!sub_pkt)
|
if (!sub_pkt)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
@ -1626,7 +1771,7 @@ static int amsdu_to_msdu(struct adapter *padapter, union recv_frame *prframe)
|
||||||
|
|
||||||
/* Indicate the packets to upper layer */
|
/* Indicate the packets to upper layer */
|
||||||
if (sub_pkt)
|
if (sub_pkt)
|
||||||
rtw_os_recv_indicate_pkt(padapter, sub_pkt, &prframe->u.hdr.attrib);
|
rtw_recv_indicate_pkt(padapter, sub_pkt, &prframe->u.hdr.attrib);
|
||||||
}
|
}
|
||||||
|
|
||||||
prframe->u.hdr.len = 0;
|
prframe->u.hdr.len = 0;
|
||||||
|
|
@ -1725,6 +1870,43 @@ static void recv_indicatepkts_pkt_loss_cnt(struct debug_priv *pdbgpriv, u64 prev
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int rtw_recv_indicatepkt(struct adapter *padapter, union recv_frame *precv_frame)
|
||||||
|
{
|
||||||
|
struct recv_priv *precvpriv;
|
||||||
|
struct __queue *pfree_recv_queue;
|
||||||
|
struct sk_buff *skb;
|
||||||
|
struct rx_pkt_attrib *pattrib = &precv_frame->u.hdr.attrib;
|
||||||
|
|
||||||
|
precvpriv = &(padapter->recvpriv);
|
||||||
|
pfree_recv_queue = &(precvpriv->free_recv_queue);
|
||||||
|
|
||||||
|
skb = precv_frame->u.hdr.pkt;
|
||||||
|
if (!skb)
|
||||||
|
goto _recv_indicatepkt_drop;
|
||||||
|
|
||||||
|
skb->data = precv_frame->u.hdr.rx_data;
|
||||||
|
|
||||||
|
skb_set_tail_pointer(skb, precv_frame->u.hdr.len);
|
||||||
|
|
||||||
|
skb->len = precv_frame->u.hdr.len;
|
||||||
|
|
||||||
|
rtw_recv_indicate_pkt(padapter, skb, pattrib);
|
||||||
|
|
||||||
|
/* pointers to NULL before rtw_free_recvframe() */
|
||||||
|
precv_frame->u.hdr.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 int recv_indicatepkts_in_order(struct adapter *padapter, struct recv_reorder_ctrl *preorder_ctrl, int bforced)
|
static int recv_indicatepkts_in_order(struct adapter *padapter, struct recv_reorder_ctrl *preorder_ctrl, int bforced)
|
||||||
{
|
{
|
||||||
struct list_head *phead, *plist;
|
struct list_head *phead, *plist;
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@
|
||||||
#include <linux/crc32.h>
|
#include <linux/crc32.h>
|
||||||
#include <drv_types.h>
|
#include <drv_types.h>
|
||||||
#include <crypto/aes.h>
|
#include <crypto/aes.h>
|
||||||
|
#include <crypto/utils.h>
|
||||||
|
|
||||||
static const char * const _security_type_str[] = {
|
static const char * const _security_type_str[] = {
|
||||||
"N/A",
|
"N/A",
|
||||||
|
|
@ -637,37 +638,6 @@ u32 rtw_tkip_decrypt(struct adapter *padapter, u8 *precvframe)
|
||||||
|
|
||||||
#define MAX_MSG_SIZE 2048
|
#define MAX_MSG_SIZE 2048
|
||||||
|
|
||||||
/*****************************/
|
|
||||||
/**** Function Prototypes ****/
|
|
||||||
/*****************************/
|
|
||||||
|
|
||||||
static void bitwise_xor(u8 *ina, u8 *inb, u8 *out);
|
|
||||||
static void construct_mic_iv(u8 *mic_header1,
|
|
||||||
signed int qc_exists,
|
|
||||||
signed int a4_exists,
|
|
||||||
u8 *mpdu,
|
|
||||||
uint payload_length,
|
|
||||||
u8 *pn_vector,
|
|
||||||
uint frtype); /* add for CONFIG_IEEE80211W, none 11w also can use */
|
|
||||||
static void construct_mic_header1(u8 *mic_header1,
|
|
||||||
signed int header_length,
|
|
||||||
u8 *mpdu,
|
|
||||||
uint frtype); /* for CONFIG_IEEE80211W, none 11w also can use */
|
|
||||||
static void construct_mic_header2(u8 *mic_header2,
|
|
||||||
u8 *mpdu,
|
|
||||||
signed int a4_exists,
|
|
||||||
signed int qc_exists);
|
|
||||||
static void construct_ctr_preload(u8 *ctr_preload,
|
|
||||||
signed int a4_exists,
|
|
||||||
signed int qc_exists,
|
|
||||||
u8 *mpdu,
|
|
||||||
u8 *pn_vector,
|
|
||||||
signed int c,
|
|
||||||
uint frtype); /* for CONFIG_IEEE80211W, none 11w also can use */
|
|
||||||
|
|
||||||
static void aes128k128d(u8 *key, u8 *data, u8 *ciphertext);
|
|
||||||
|
|
||||||
|
|
||||||
/****************************************/
|
/****************************************/
|
||||||
/* aes128k128d() */
|
/* aes128k128d() */
|
||||||
/* Performs a 128 bit AES encrypt with */
|
/* Performs a 128 bit AES encrypt with */
|
||||||
|
|
@ -849,18 +819,6 @@ static void construct_ctr_preload(u8 *ctr_preload,
|
||||||
ctr_preload[15] = (unsigned char) (c % 256);
|
ctr_preload[15] = (unsigned char) (c % 256);
|
||||||
}
|
}
|
||||||
|
|
||||||
/************************************/
|
|
||||||
/* bitwise_xor() */
|
|
||||||
/* A 128 bit, bitwise exclusive or */
|
|
||||||
/************************************/
|
|
||||||
static void bitwise_xor(u8 *ina, u8 *inb, u8 *out)
|
|
||||||
{
|
|
||||||
signed int i;
|
|
||||||
|
|
||||||
for (i = 0; i < 16; i++)
|
|
||||||
out[i] = ina[i] ^ inb[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
static signed int aes_cipher(u8 *key, uint hdrlen,
|
static signed int aes_cipher(u8 *key, uint hdrlen,
|
||||||
u8 *pframe, uint plen)
|
u8 *pframe, uint plen)
|
||||||
{
|
{
|
||||||
|
|
@ -941,13 +899,13 @@ static signed int aes_cipher(u8 *key, uint hdrlen,
|
||||||
|
|
||||||
/* Calculate MIC */
|
/* Calculate MIC */
|
||||||
aes128k128d(key, mic_iv, aes_out);
|
aes128k128d(key, mic_iv, aes_out);
|
||||||
bitwise_xor(aes_out, mic_header1, chain_buffer);
|
crypto_xor_cpy(chain_buffer, aes_out, mic_header1, 16);
|
||||||
aes128k128d(key, chain_buffer, aes_out);
|
aes128k128d(key, chain_buffer, aes_out);
|
||||||
bitwise_xor(aes_out, mic_header2, chain_buffer);
|
crypto_xor_cpy(chain_buffer, aes_out, mic_header2, 16);
|
||||||
aes128k128d(key, chain_buffer, aes_out);
|
aes128k128d(key, chain_buffer, aes_out);
|
||||||
|
|
||||||
for (i = 0; i < num_blocks; i++) {
|
for (i = 0; i < num_blocks; i++) {
|
||||||
bitwise_xor(aes_out, &pframe[payload_index], chain_buffer);
|
crypto_xor_cpy(chain_buffer, aes_out, &pframe[payload_index], 16);
|
||||||
|
|
||||||
payload_index += 16;
|
payload_index += 16;
|
||||||
aes128k128d(key, chain_buffer, aes_out);
|
aes128k128d(key, chain_buffer, aes_out);
|
||||||
|
|
@ -960,7 +918,7 @@ static signed int aes_cipher(u8 *key, uint hdrlen,
|
||||||
for (j = 0; j < payload_remainder; j++)
|
for (j = 0; j < payload_remainder; j++)
|
||||||
padded_buffer[j] = pframe[payload_index++];
|
padded_buffer[j] = pframe[payload_index++];
|
||||||
|
|
||||||
bitwise_xor(aes_out, padded_buffer, chain_buffer);
|
crypto_xor_cpy(chain_buffer, aes_out, padded_buffer, 16);
|
||||||
aes128k128d(key, chain_buffer, aes_out);
|
aes128k128d(key, chain_buffer, aes_out);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -977,7 +935,7 @@ static signed int aes_cipher(u8 *key, uint hdrlen,
|
||||||
pn_vector, i+1, frtype);
|
pn_vector, i+1, frtype);
|
||||||
/* add for CONFIG_IEEE80211W, none 11w also can use */
|
/* add for CONFIG_IEEE80211W, none 11w also can use */
|
||||||
aes128k128d(key, ctr_preload, aes_out);
|
aes128k128d(key, ctr_preload, aes_out);
|
||||||
bitwise_xor(aes_out, &pframe[payload_index], chain_buffer);
|
crypto_xor_cpy(chain_buffer, aes_out, &pframe[payload_index], 16);
|
||||||
for (j = 0; j < 16; j++)
|
for (j = 0; j < 16; j++)
|
||||||
pframe[payload_index++] = chain_buffer[j];
|
pframe[payload_index++] = chain_buffer[j];
|
||||||
}
|
}
|
||||||
|
|
@ -995,7 +953,7 @@ static signed int aes_cipher(u8 *key, uint hdrlen,
|
||||||
padded_buffer[j] = pframe[payload_index+j];
|
padded_buffer[j] = pframe[payload_index+j];
|
||||||
|
|
||||||
aes128k128d(key, ctr_preload, aes_out);
|
aes128k128d(key, ctr_preload, aes_out);
|
||||||
bitwise_xor(aes_out, padded_buffer, chain_buffer);
|
crypto_xor_cpy(chain_buffer, aes_out, padded_buffer, 16);
|
||||||
for (j = 0; j < payload_remainder; j++)
|
for (j = 0; j < payload_remainder; j++)
|
||||||
pframe[payload_index++] = chain_buffer[j];
|
pframe[payload_index++] = chain_buffer[j];
|
||||||
}
|
}
|
||||||
|
|
@ -1011,7 +969,7 @@ static signed int aes_cipher(u8 *key, uint hdrlen,
|
||||||
padded_buffer[j] = pframe[j+hdrlen+8+plen];
|
padded_buffer[j] = pframe[j+hdrlen+8+plen];
|
||||||
|
|
||||||
aes128k128d(key, ctr_preload, aes_out);
|
aes128k128d(key, ctr_preload, aes_out);
|
||||||
bitwise_xor(aes_out, padded_buffer, chain_buffer);
|
crypto_xor_cpy(chain_buffer, aes_out, padded_buffer, 16);
|
||||||
for (j = 0; j < 8; j++)
|
for (j = 0; j < 8; j++)
|
||||||
pframe[payload_index++] = chain_buffer[j];
|
pframe[payload_index++] = chain_buffer[j];
|
||||||
|
|
||||||
|
|
@ -1137,7 +1095,7 @@ static signed int aes_decipher(u8 *key, uint hdrlen,
|
||||||
frtype); /* add for CONFIG_IEEE80211W, none 11w also can use */
|
frtype); /* add for CONFIG_IEEE80211W, none 11w also can use */
|
||||||
|
|
||||||
aes128k128d(key, ctr_preload, aes_out);
|
aes128k128d(key, ctr_preload, aes_out);
|
||||||
bitwise_xor(aes_out, &pframe[payload_index], chain_buffer);
|
crypto_xor_cpy(chain_buffer, aes_out, &pframe[payload_index], 16);
|
||||||
|
|
||||||
for (j = 0; j < 16; j++)
|
for (j = 0; j < 16; j++)
|
||||||
pframe[payload_index++] = chain_buffer[j];
|
pframe[payload_index++] = chain_buffer[j];
|
||||||
|
|
@ -1156,7 +1114,7 @@ static signed int aes_decipher(u8 *key, uint hdrlen,
|
||||||
padded_buffer[j] = pframe[payload_index+j];
|
padded_buffer[j] = pframe[payload_index+j];
|
||||||
|
|
||||||
aes128k128d(key, ctr_preload, aes_out);
|
aes128k128d(key, ctr_preload, aes_out);
|
||||||
bitwise_xor(aes_out, padded_buffer, chain_buffer);
|
crypto_xor_cpy(chain_buffer, aes_out, padded_buffer, 16);
|
||||||
for (j = 0; j < payload_remainder; j++)
|
for (j = 0; j < payload_remainder; j++)
|
||||||
pframe[payload_index++] = chain_buffer[j];
|
pframe[payload_index++] = chain_buffer[j];
|
||||||
}
|
}
|
||||||
|
|
@ -1187,13 +1145,13 @@ static signed int aes_decipher(u8 *key, uint hdrlen,
|
||||||
|
|
||||||
/* Calculate MIC */
|
/* Calculate MIC */
|
||||||
aes128k128d(key, mic_iv, aes_out);
|
aes128k128d(key, mic_iv, aes_out);
|
||||||
bitwise_xor(aes_out, mic_header1, chain_buffer);
|
crypto_xor_cpy(chain_buffer, aes_out, mic_header1, 16);
|
||||||
aes128k128d(key, chain_buffer, aes_out);
|
aes128k128d(key, chain_buffer, aes_out);
|
||||||
bitwise_xor(aes_out, mic_header2, chain_buffer);
|
crypto_xor_cpy(chain_buffer, aes_out, mic_header2, 16);
|
||||||
aes128k128d(key, chain_buffer, aes_out);
|
aes128k128d(key, chain_buffer, aes_out);
|
||||||
|
|
||||||
for (i = 0; i < num_blocks; i++) {
|
for (i = 0; i < num_blocks; i++) {
|
||||||
bitwise_xor(aes_out, &message[payload_index], chain_buffer);
|
crypto_xor_cpy(chain_buffer, aes_out, &message[payload_index], 16);
|
||||||
|
|
||||||
payload_index += 16;
|
payload_index += 16;
|
||||||
aes128k128d(key, chain_buffer, aes_out);
|
aes128k128d(key, chain_buffer, aes_out);
|
||||||
|
|
@ -1206,7 +1164,7 @@ static signed int aes_decipher(u8 *key, uint hdrlen,
|
||||||
for (j = 0; j < payload_remainder; j++)
|
for (j = 0; j < payload_remainder; j++)
|
||||||
padded_buffer[j] = message[payload_index++];
|
padded_buffer[j] = message[payload_index++];
|
||||||
|
|
||||||
bitwise_xor(aes_out, padded_buffer, chain_buffer);
|
crypto_xor_cpy(chain_buffer, aes_out, padded_buffer, 16);
|
||||||
aes128k128d(key, chain_buffer, aes_out);
|
aes128k128d(key, chain_buffer, aes_out);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1223,7 +1181,7 @@ static signed int aes_decipher(u8 *key, uint hdrlen,
|
||||||
frtype);
|
frtype);
|
||||||
/* add for CONFIG_IEEE80211W, none 11w also can use */
|
/* add for CONFIG_IEEE80211W, none 11w also can use */
|
||||||
aes128k128d(key, ctr_preload, aes_out);
|
aes128k128d(key, ctr_preload, aes_out);
|
||||||
bitwise_xor(aes_out, &message[payload_index], chain_buffer);
|
crypto_xor_cpy(chain_buffer, aes_out, &message[payload_index], 16);
|
||||||
for (j = 0; j < 16; j++)
|
for (j = 0; j < 16; j++)
|
||||||
message[payload_index++] = chain_buffer[j];
|
message[payload_index++] = chain_buffer[j];
|
||||||
}
|
}
|
||||||
|
|
@ -1241,7 +1199,7 @@ static signed int aes_decipher(u8 *key, uint hdrlen,
|
||||||
padded_buffer[j] = message[payload_index+j];
|
padded_buffer[j] = message[payload_index+j];
|
||||||
|
|
||||||
aes128k128d(key, ctr_preload, aes_out);
|
aes128k128d(key, ctr_preload, aes_out);
|
||||||
bitwise_xor(aes_out, padded_buffer, chain_buffer);
|
crypto_xor_cpy(chain_buffer, aes_out, padded_buffer, 16);
|
||||||
for (j = 0; j < payload_remainder; j++)
|
for (j = 0; j < payload_remainder; j++)
|
||||||
message[payload_index++] = chain_buffer[j];
|
message[payload_index++] = chain_buffer[j];
|
||||||
}
|
}
|
||||||
|
|
@ -1256,7 +1214,7 @@ static signed int aes_decipher(u8 *key, uint hdrlen,
|
||||||
padded_buffer[j] = message[j+hdrlen+8+plen-8];
|
padded_buffer[j] = message[j+hdrlen+8+plen-8];
|
||||||
|
|
||||||
aes128k128d(key, ctr_preload, aes_out);
|
aes128k128d(key, ctr_preload, aes_out);
|
||||||
bitwise_xor(aes_out, padded_buffer, chain_buffer);
|
crypto_xor_cpy(chain_buffer, aes_out, padded_buffer, 16);
|
||||||
for (j = 0; j < 8; j++)
|
for (j = 0; j < 8; j++)
|
||||||
message[payload_index++] = chain_buffer[j];
|
message[payload_index++] = chain_buffer[j];
|
||||||
|
|
||||||
|
|
@ -1405,7 +1363,7 @@ u32 rtw_BIP_verify(struct adapter *padapter, u8 *precvframe)
|
||||||
ClearPwrMgt(BIP_AAD);
|
ClearPwrMgt(BIP_AAD);
|
||||||
ClearMData(BIP_AAD);
|
ClearMData(BIP_AAD);
|
||||||
/* conscruct AAD, copy address 1 to address 3 */
|
/* conscruct AAD, copy address 1 to address 3 */
|
||||||
memcpy(BIP_AAD+2, pwlanhdr->addr1, 18);
|
memcpy(BIP_AAD + 2, &pwlanhdr->addrs, sizeof(pwlanhdr->addrs));
|
||||||
|
|
||||||
if (omac1_aes_128(padapter->securitypriv.dot11wBIPKey[padapter->securitypriv.dot11wBIPKeyid].skey
|
if (omac1_aes_128(padapter->securitypriv.dot11wBIPKey[padapter->securitypriv.dot11wBIPKeyid].skey
|
||||||
, BIP_AAD, ori_len, mic))
|
, BIP_AAD, ori_len, mic))
|
||||||
|
|
|
||||||
|
|
@ -229,7 +229,7 @@ struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
|
||||||
for (i = 0; i < 16; i++)
|
for (i = 0; i < 16; i++)
|
||||||
memcpy(&psta->sta_recvpriv.rxcache.tid_rxseq[i], &wRxSeqInitialValue, 2);
|
memcpy(&psta->sta_recvpriv.rxcache.tid_rxseq[i], &wRxSeqInitialValue, 2);
|
||||||
|
|
||||||
init_addba_retry_timer(pstapriv->padapter, psta);
|
timer_setup(&psta->addba_retry_timer, addba_timer_hdl, 0);
|
||||||
|
|
||||||
/* for A-MPDU Rx reordering buffer control */
|
/* for A-MPDU Rx reordering buffer control */
|
||||||
for (i = 0; i < 16 ; i++) {
|
for (i = 0; i < 16 ; i++) {
|
||||||
|
|
@ -247,7 +247,9 @@ struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
|
||||||
INIT_LIST_HEAD(&preorder_ctrl->pending_recvframe_queue.queue);
|
INIT_LIST_HEAD(&preorder_ctrl->pending_recvframe_queue.queue);
|
||||||
spin_lock_init(&preorder_ctrl->pending_recvframe_queue.lock);
|
spin_lock_init(&preorder_ctrl->pending_recvframe_queue.lock);
|
||||||
|
|
||||||
rtw_init_recv_timer(preorder_ctrl);
|
/* init recv timer */
|
||||||
|
timer_setup(&preorder_ctrl->reordering_ctrl_timer,
|
||||||
|
rtw_reordering_ctrl_timeout_handler, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* init for DM */
|
/* init for DM */
|
||||||
|
|
|
||||||
|
|
@ -1209,7 +1209,7 @@ s32 rtw_mgmt_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, s
|
||||||
ClearPwrMgt(BIP_AAD);
|
ClearPwrMgt(BIP_AAD);
|
||||||
ClearMData(BIP_AAD);
|
ClearMData(BIP_AAD);
|
||||||
/* conscruct AAD, copy address 1 to address 3 */
|
/* conscruct AAD, copy address 1 to address 3 */
|
||||||
memcpy(BIP_AAD+2, pwlanhdr->addr1, 18);
|
memcpy(BIP_AAD + 2, &pwlanhdr->addrs, sizeof(pwlanhdr->addrs));
|
||||||
/* copy management fram body */
|
/* copy management fram body */
|
||||||
memcpy(BIP_AAD+BIP_AAD_SIZE, MGMT_body, frame_body_len);
|
memcpy(BIP_AAD+BIP_AAD_SIZE, MGMT_body, frame_body_len);
|
||||||
/* calculate mic */
|
/* calculate mic */
|
||||||
|
|
|
||||||
|
|
@ -59,10 +59,7 @@ phy_SetTxPowerByRateBase(struct adapter *Adapter, u8 RfPath,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void phy_StoreTxPowerByRateBase(struct adapter *padapter)
|
||||||
phy_StoreTxPowerByRateBase(
|
|
||||||
struct adapter *padapter
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
u8 path, base;
|
u8 path, base;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
This file includes all kinds of Power Action event for RTL8723B
|
This file includes all kinds of Power Action event for RTL8723B
|
||||||
and corresponding hardware configurtions which are released from HW SD.
|
and corresponding hardware configurations which are released from HW SD.
|
||||||
|
|
||||||
Major Change History:
|
Major Change History:
|
||||||
When Who What
|
When Who What
|
||||||
|
|
|
||||||
|
|
@ -9,118 +9,6 @@
|
||||||
|
|
||||||
/* Global var */
|
/* Global var */
|
||||||
|
|
||||||
u32 OFDMSwingTable[OFDM_TABLE_SIZE] = {
|
|
||||||
0x7f8001fe, /* 0, +6.0dB */
|
|
||||||
0x788001e2, /* 1, +5.5dB */
|
|
||||||
0x71c001c7, /* 2, +5.0dB */
|
|
||||||
0x6b8001ae, /* 3, +4.5dB */
|
|
||||||
0x65400195, /* 4, +4.0dB */
|
|
||||||
0x5fc0017f, /* 5, +3.5dB */
|
|
||||||
0x5a400169, /* 6, +3.0dB */
|
|
||||||
0x55400155, /* 7, +2.5dB */
|
|
||||||
0x50800142, /* 8, +2.0dB */
|
|
||||||
0x4c000130, /* 9, +1.5dB */
|
|
||||||
0x47c0011f, /* 10, +1.0dB */
|
|
||||||
0x43c0010f, /* 11, +0.5dB */
|
|
||||||
0x40000100, /* 12, +0dB */
|
|
||||||
0x3c8000f2, /* 13, -0.5dB */
|
|
||||||
0x390000e4, /* 14, -1.0dB */
|
|
||||||
0x35c000d7, /* 15, -1.5dB */
|
|
||||||
0x32c000cb, /* 16, -2.0dB */
|
|
||||||
0x300000c0, /* 17, -2.5dB */
|
|
||||||
0x2d4000b5, /* 18, -3.0dB */
|
|
||||||
0x2ac000ab, /* 19, -3.5dB */
|
|
||||||
0x288000a2, /* 20, -4.0dB */
|
|
||||||
0x26000098, /* 21, -4.5dB */
|
|
||||||
0x24000090, /* 22, -5.0dB */
|
|
||||||
0x22000088, /* 23, -5.5dB */
|
|
||||||
0x20000080, /* 24, -6.0dB */
|
|
||||||
0x1e400079, /* 25, -6.5dB */
|
|
||||||
0x1c800072, /* 26, -7.0dB */
|
|
||||||
0x1b00006c, /* 27. -7.5dB */
|
|
||||||
0x19800066, /* 28, -8.0dB */
|
|
||||||
0x18000060, /* 29, -8.5dB */
|
|
||||||
0x16c0005b, /* 30, -9.0dB */
|
|
||||||
0x15800056, /* 31, -9.5dB */
|
|
||||||
0x14400051, /* 32, -10.0dB */
|
|
||||||
0x1300004c, /* 33, -10.5dB */
|
|
||||||
0x12000048, /* 34, -11.0dB */
|
|
||||||
0x11000044, /* 35, -11.5dB */
|
|
||||||
0x10000040, /* 36, -12.0dB */
|
|
||||||
};
|
|
||||||
|
|
||||||
u8 CCKSwingTable_Ch1_Ch13[CCK_TABLE_SIZE][8] = {
|
|
||||||
{0x36, 0x35, 0x2e, 0x25, 0x1c, 0x12, 0x09, 0x04}, /* 0, +0dB */
|
|
||||||
{0x33, 0x32, 0x2b, 0x23, 0x1a, 0x11, 0x08, 0x04}, /* 1, -0.5dB */
|
|
||||||
{0x30, 0x2f, 0x29, 0x21, 0x19, 0x10, 0x08, 0x03}, /* 2, -1.0dB */
|
|
||||||
{0x2d, 0x2d, 0x27, 0x1f, 0x18, 0x0f, 0x08, 0x03}, /* 3, -1.5dB */
|
|
||||||
{0x2b, 0x2a, 0x25, 0x1e, 0x16, 0x0e, 0x07, 0x03}, /* 4, -2.0dB */
|
|
||||||
{0x28, 0x28, 0x22, 0x1c, 0x15, 0x0d, 0x07, 0x03}, /* 5, -2.5dB */
|
|
||||||
{0x26, 0x25, 0x21, 0x1b, 0x14, 0x0d, 0x06, 0x03}, /* 6, -3.0dB */
|
|
||||||
{0x24, 0x23, 0x1f, 0x19, 0x13, 0x0c, 0x06, 0x03}, /* 7, -3.5dB */
|
|
||||||
{0x22, 0x21, 0x1d, 0x18, 0x11, 0x0b, 0x06, 0x02}, /* 8, -4.0dB */
|
|
||||||
{0x20, 0x20, 0x1b, 0x16, 0x11, 0x08, 0x05, 0x02}, /* 9, -4.5dB */
|
|
||||||
{0x1f, 0x1e, 0x1a, 0x15, 0x10, 0x0a, 0x05, 0x02}, /* 10, -5.0dB */
|
|
||||||
{0x1d, 0x1c, 0x18, 0x14, 0x0f, 0x0a, 0x05, 0x02}, /* 11, -5.5dB */
|
|
||||||
{0x1b, 0x1a, 0x17, 0x13, 0x0e, 0x09, 0x04, 0x02}, /* 12, -6.0dB <== default */
|
|
||||||
{0x1a, 0x19, 0x16, 0x12, 0x0d, 0x09, 0x04, 0x02}, /* 13, -6.5dB */
|
|
||||||
{0x18, 0x17, 0x15, 0x11, 0x0c, 0x08, 0x04, 0x02}, /* 14, -7.0dB */
|
|
||||||
{0x17, 0x16, 0x13, 0x10, 0x0c, 0x08, 0x04, 0x02}, /* 15, -7.5dB */
|
|
||||||
{0x16, 0x15, 0x12, 0x0f, 0x0b, 0x07, 0x04, 0x01}, /* 16, -8.0dB */
|
|
||||||
{0x14, 0x14, 0x11, 0x0e, 0x0b, 0x07, 0x03, 0x02}, /* 17, -8.5dB */
|
|
||||||
{0x13, 0x13, 0x10, 0x0d, 0x0a, 0x06, 0x03, 0x01}, /* 18, -9.0dB */
|
|
||||||
{0x12, 0x12, 0x0f, 0x0c, 0x09, 0x06, 0x03, 0x01}, /* 19, -9.5dB */
|
|
||||||
{0x11, 0x11, 0x0f, 0x0c, 0x09, 0x06, 0x03, 0x01}, /* 20, -10.0dB */
|
|
||||||
{0x10, 0x10, 0x0e, 0x0b, 0x08, 0x05, 0x03, 0x01}, /* 21, -10.5dB */
|
|
||||||
{0x0f, 0x0f, 0x0d, 0x0b, 0x08, 0x05, 0x03, 0x01}, /* 22, -11.0dB */
|
|
||||||
{0x0e, 0x0e, 0x0c, 0x0a, 0x08, 0x05, 0x02, 0x01}, /* 23, -11.5dB */
|
|
||||||
{0x0d, 0x0d, 0x0c, 0x0a, 0x07, 0x05, 0x02, 0x01}, /* 24, -12.0dB */
|
|
||||||
{0x0d, 0x0c, 0x0b, 0x09, 0x07, 0x04, 0x02, 0x01}, /* 25, -12.5dB */
|
|
||||||
{0x0c, 0x0c, 0x0a, 0x09, 0x06, 0x04, 0x02, 0x01}, /* 26, -13.0dB */
|
|
||||||
{0x0b, 0x0b, 0x0a, 0x08, 0x06, 0x04, 0x02, 0x01}, /* 27, -13.5dB */
|
|
||||||
{0x0b, 0x0a, 0x09, 0x08, 0x06, 0x04, 0x02, 0x01}, /* 28, -14.0dB */
|
|
||||||
{0x0a, 0x0a, 0x09, 0x07, 0x05, 0x03, 0x02, 0x01}, /* 29, -14.5dB */
|
|
||||||
{0x0a, 0x09, 0x08, 0x07, 0x05, 0x03, 0x02, 0x01}, /* 30, -15.0dB */
|
|
||||||
{0x09, 0x09, 0x08, 0x06, 0x05, 0x03, 0x01, 0x01}, /* 31, -15.5dB */
|
|
||||||
{0x09, 0x08, 0x07, 0x06, 0x04, 0x03, 0x01, 0x01} /* 32, -16.0dB */
|
|
||||||
};
|
|
||||||
|
|
||||||
u8 CCKSwingTable_Ch14[CCK_TABLE_SIZE][8] = {
|
|
||||||
{0x36, 0x35, 0x2e, 0x1b, 0x00, 0x00, 0x00, 0x00}, /* 0, +0dB */
|
|
||||||
{0x33, 0x32, 0x2b, 0x19, 0x00, 0x00, 0x00, 0x00}, /* 1, -0.5dB */
|
|
||||||
{0x30, 0x2f, 0x29, 0x18, 0x00, 0x00, 0x00, 0x00}, /* 2, -1.0dB */
|
|
||||||
{0x2d, 0x2d, 0x17, 0x17, 0x00, 0x00, 0x00, 0x00}, /* 3, -1.5dB */
|
|
||||||
{0x2b, 0x2a, 0x25, 0x15, 0x00, 0x00, 0x00, 0x00}, /* 4, -2.0dB */
|
|
||||||
{0x28, 0x28, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00}, /* 5, -2.5dB */
|
|
||||||
{0x26, 0x25, 0x21, 0x13, 0x00, 0x00, 0x00, 0x00}, /* 6, -3.0dB */
|
|
||||||
{0x24, 0x23, 0x1f, 0x12, 0x00, 0x00, 0x00, 0x00}, /* 7, -3.5dB */
|
|
||||||
{0x22, 0x21, 0x1d, 0x11, 0x00, 0x00, 0x00, 0x00}, /* 8, -4.0dB */
|
|
||||||
{0x20, 0x20, 0x1b, 0x10, 0x00, 0x00, 0x00, 0x00}, /* 9, -4.5dB */
|
|
||||||
{0x1f, 0x1e, 0x1a, 0x0f, 0x00, 0x00, 0x00, 0x00}, /* 10, -5.0dB */
|
|
||||||
{0x1d, 0x1c, 0x18, 0x0e, 0x00, 0x00, 0x00, 0x00}, /* 11, -5.5dB */
|
|
||||||
{0x1b, 0x1a, 0x17, 0x0e, 0x00, 0x00, 0x00, 0x00}, /* 12, -6.0dB <== default */
|
|
||||||
{0x1a, 0x19, 0x16, 0x0d, 0x00, 0x00, 0x00, 0x00}, /* 13, -6.5dB */
|
|
||||||
{0x18, 0x17, 0x15, 0x0c, 0x00, 0x00, 0x00, 0x00}, /* 14, -7.0dB */
|
|
||||||
{0x17, 0x16, 0x13, 0x0b, 0x00, 0x00, 0x00, 0x00}, /* 15, -7.5dB */
|
|
||||||
{0x16, 0x15, 0x12, 0x0b, 0x00, 0x00, 0x00, 0x00}, /* 16, -8.0dB */
|
|
||||||
{0x14, 0x14, 0x11, 0x0a, 0x00, 0x00, 0x00, 0x00}, /* 17, -8.5dB */
|
|
||||||
{0x13, 0x13, 0x10, 0x0a, 0x00, 0x00, 0x00, 0x00}, /* 18, -9.0dB */
|
|
||||||
{0x12, 0x12, 0x0f, 0x09, 0x00, 0x00, 0x00, 0x00}, /* 19, -9.5dB */
|
|
||||||
{0x11, 0x11, 0x0f, 0x09, 0x00, 0x00, 0x00, 0x00}, /* 20, -10.0dB */
|
|
||||||
{0x10, 0x10, 0x0e, 0x08, 0x00, 0x00, 0x00, 0x00}, /* 21, -10.5dB */
|
|
||||||
{0x0f, 0x0f, 0x0d, 0x08, 0x00, 0x00, 0x00, 0x00}, /* 22, -11.0dB */
|
|
||||||
{0x0e, 0x0e, 0x0c, 0x07, 0x00, 0x00, 0x00, 0x00}, /* 23, -11.5dB */
|
|
||||||
{0x0d, 0x0d, 0x0c, 0x07, 0x00, 0x00, 0x00, 0x00}, /* 24, -12.0dB */
|
|
||||||
{0x0d, 0x0c, 0x0b, 0x06, 0x00, 0x00, 0x00, 0x00}, /* 25, -12.5dB */
|
|
||||||
{0x0c, 0x0c, 0x0a, 0x06, 0x00, 0x00, 0x00, 0x00}, /* 26, -13.0dB */
|
|
||||||
{0x0b, 0x0b, 0x0a, 0x06, 0x00, 0x00, 0x00, 0x00}, /* 27, -13.5dB */
|
|
||||||
{0x0b, 0x0a, 0x09, 0x05, 0x00, 0x00, 0x00, 0x00}, /* 28, -14.0dB */
|
|
||||||
{0x0a, 0x0a, 0x09, 0x05, 0x00, 0x00, 0x00, 0x00}, /* 29, -14.5dB */
|
|
||||||
{0x0a, 0x09, 0x08, 0x05, 0x00, 0x00, 0x00, 0x00}, /* 30, -15.0dB */
|
|
||||||
{0x09, 0x09, 0x08, 0x05, 0x00, 0x00, 0x00, 0x00}, /* 31, -15.5dB */
|
|
||||||
{0x09, 0x08, 0x07, 0x04, 0x00, 0x00, 0x00, 0x00} /* 32, -16.0dB */
|
|
||||||
};
|
|
||||||
|
|
||||||
u32 OFDMSwingTable_New[OFDM_TABLE_SIZE] = {
|
u32 OFDMSwingTable_New[OFDM_TABLE_SIZE] = {
|
||||||
0x0b40002d, /* 0, -15.0dB */
|
0x0b40002d, /* 0, -15.0dB */
|
||||||
0x0c000030, /* 1, -14.5dB */
|
0x0c000030, /* 1, -14.5dB */
|
||||||
|
|
@ -239,46 +127,6 @@ u8 CCKSwingTable_Ch14_New[CCK_TABLE_SIZE][8] = {
|
||||||
{0x36, 0x35, 0x2e, 0x1b, 0x00, 0x00, 0x00, 0x00} /* 32, +0dB */
|
{0x36, 0x35, 0x2e, 0x1b, 0x00, 0x00, 0x00, 0x00} /* 32, +0dB */
|
||||||
};
|
};
|
||||||
|
|
||||||
u32 TxScalingTable_Jaguar[TXSCALE_TABLE_SIZE] = {
|
|
||||||
0x081, /* 0, -12.0dB */
|
|
||||||
0x088, /* 1, -11.5dB */
|
|
||||||
0x090, /* 2, -11.0dB */
|
|
||||||
0x099, /* 3, -10.5dB */
|
|
||||||
0x0A2, /* 4, -10.0dB */
|
|
||||||
0x0AC, /* 5, -9.5dB */
|
|
||||||
0x0B6, /* 6, -9.0dB */
|
|
||||||
0x0C0, /* 7, -8.5dB */
|
|
||||||
0x0CC, /* 8, -8.0dB */
|
|
||||||
0x0D8, /* 9, -7.5dB */
|
|
||||||
0x0E5, /* 10, -7.0dB */
|
|
||||||
0x0F2, /* 11, -6.5dB */
|
|
||||||
0x101, /* 12, -6.0dB */
|
|
||||||
0x110, /* 13, -5.5dB */
|
|
||||||
0x120, /* 14, -5.0dB */
|
|
||||||
0x131, /* 15, -4.5dB */
|
|
||||||
0x143, /* 16, -4.0dB */
|
|
||||||
0x156, /* 17, -3.5dB */
|
|
||||||
0x16A, /* 18, -3.0dB */
|
|
||||||
0x180, /* 19, -2.5dB */
|
|
||||||
0x197, /* 20, -2.0dB */
|
|
||||||
0x1AF, /* 21, -1.5dB */
|
|
||||||
0x1C8, /* 22, -1.0dB */
|
|
||||||
0x1E3, /* 23, -0.5dB */
|
|
||||||
0x200, /* 24, +0 dB */
|
|
||||||
0x21E, /* 25, +0.5dB */
|
|
||||||
0x23E, /* 26, +1.0dB */
|
|
||||||
0x261, /* 27, +1.5dB */
|
|
||||||
0x285, /* 28, +2.0dB */
|
|
||||||
0x2AB, /* 29, +2.5dB */
|
|
||||||
0x2D3, /* 30, +3.0dB */
|
|
||||||
0x2FE, /* 31, +3.5dB */
|
|
||||||
0x32B, /* 32, +4.0dB */
|
|
||||||
0x35C, /* 33, +4.5dB */
|
|
||||||
0x38E, /* 34, +5.0dB */
|
|
||||||
0x3C4, /* 35, +5.5dB */
|
|
||||||
0x3FE /* 36, +6.0dB */
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Remove Edca by Yu Chen */
|
/* Remove Edca by Yu Chen */
|
||||||
|
|
||||||
static void odm_CommonInfoSelfInit(struct dm_odm_t *pDM_Odm)
|
static void odm_CommonInfoSelfInit(struct dm_odm_t *pDM_Odm)
|
||||||
|
|
|
||||||
|
|
@ -1080,16 +1080,10 @@ enum { /* tag_RF_Type_Definition */
|
||||||
/* */
|
/* */
|
||||||
/* Extern Global Variables. */
|
/* Extern Global Variables. */
|
||||||
/* */
|
/* */
|
||||||
extern u32 OFDMSwingTable[OFDM_TABLE_SIZE];
|
|
||||||
extern u8 CCKSwingTable_Ch1_Ch13[CCK_TABLE_SIZE][8];
|
|
||||||
extern u8 CCKSwingTable_Ch14[CCK_TABLE_SIZE][8];
|
|
||||||
|
|
||||||
extern u32 OFDMSwingTable_New[OFDM_TABLE_SIZE];
|
extern u32 OFDMSwingTable_New[OFDM_TABLE_SIZE];
|
||||||
extern u8 CCKSwingTable_Ch1_Ch13_New[CCK_TABLE_SIZE][8];
|
extern u8 CCKSwingTable_Ch1_Ch13_New[CCK_TABLE_SIZE][8];
|
||||||
extern u8 CCKSwingTable_Ch14_New[CCK_TABLE_SIZE][8];
|
extern u8 CCKSwingTable_Ch14_New[CCK_TABLE_SIZE][8];
|
||||||
|
|
||||||
extern u32 TxScalingTable_Jaguar[TXSCALE_TABLE_SIZE];
|
|
||||||
|
|
||||||
/* */
|
/* */
|
||||||
/* check Sta pointer valid or not */
|
/* check Sta pointer valid or not */
|
||||||
/* */
|
/* */
|
||||||
|
|
|
||||||
|
|
@ -445,27 +445,12 @@ void rtl8723b_InitializeFirmwareVars(struct adapter *padapter)
|
||||||
/* Efuse related code */
|
/* Efuse related code */
|
||||||
/* */
|
/* */
|
||||||
static u8 hal_EfuseSwitchToBank(
|
static u8 hal_EfuseSwitchToBank(
|
||||||
struct adapter *padapter, u8 bank, bool bPseudoTest
|
struct adapter *padapter, u8 bank
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
u8 bRet = false;
|
u8 bRet = true;
|
||||||
u32 value32 = 0;
|
u32 value32 = rtw_read32(padapter, EFUSE_TEST);
|
||||||
#ifdef HAL_EFUSE_MEMORY
|
|
||||||
struct hal_com_data *pHalData = GET_HAL_DATA(padapter);
|
|
||||||
struct efuse_hal *pEfuseHal = &pHalData->EfuseHal;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
if (bPseudoTest) {
|
|
||||||
#ifdef HAL_EFUSE_MEMORY
|
|
||||||
pEfuseHal->fakeEfuseBank = bank;
|
|
||||||
#else
|
|
||||||
fakeEfuseBank = bank;
|
|
||||||
#endif
|
|
||||||
bRet = true;
|
|
||||||
} else {
|
|
||||||
value32 = rtw_read32(padapter, EFUSE_TEST);
|
|
||||||
bRet = true;
|
|
||||||
switch (bank) {
|
switch (bank) {
|
||||||
case 0:
|
case 0:
|
||||||
value32 = (value32 & ~EFUSE_SEL_MASK) | EFUSE_SEL(EFUSE_WIFI_SEL_0);
|
value32 = (value32 & ~EFUSE_SEL_MASK) | EFUSE_SEL(EFUSE_WIFI_SEL_0);
|
||||||
|
|
@ -485,7 +470,6 @@ static u8 hal_EfuseSwitchToBank(
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
rtw_write32(padapter, EFUSE_TEST, value32);
|
rtw_write32(padapter, EFUSE_TEST, value32);
|
||||||
}
|
|
||||||
|
|
||||||
return bRet;
|
return bRet;
|
||||||
}
|
}
|
||||||
|
|
@ -494,8 +478,7 @@ void Hal_GetEfuseDefinition(
|
||||||
struct adapter *padapter,
|
struct adapter *padapter,
|
||||||
u8 efuseType,
|
u8 efuseType,
|
||||||
u8 type,
|
u8 type,
|
||||||
void *pOut,
|
void *pOut
|
||||||
bool bPseudoTest
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
|
@ -585,17 +568,8 @@ void Hal_GetEfuseDefinition(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#define VOLTAGE_V25 0x03
|
|
||||||
|
|
||||||
/* */
|
|
||||||
/* The following is for compile ok */
|
|
||||||
/* That should be merged with the original in the future */
|
|
||||||
/* */
|
|
||||||
#define EFUSE_ACCESS_ON_8723 0x69 /* For RTL8723 only. */
|
|
||||||
#define REG_EFUSE_ACCESS_8723 0x00CF /* Efuse access protection for RTL8723 */
|
|
||||||
|
|
||||||
void Hal_EfusePowerSwitch(
|
void Hal_EfusePowerSwitch(
|
||||||
struct adapter *padapter, u8 bWrite, u8 PwrState
|
struct adapter *padapter, u8 PwrState
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
u8 tempval;
|
u8 tempval;
|
||||||
|
|
@ -628,7 +602,7 @@ void Hal_EfusePowerSwitch(
|
||||||
} while (1);
|
} while (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
rtw_write8(padapter, REG_EFUSE_ACCESS_8723, EFUSE_ACCESS_ON_8723);
|
rtw_write8(padapter, REG_EFUSE_ACCESS, EFUSE_ACCESS_ON);
|
||||||
|
|
||||||
/* Reset: 0x0000h[28], default valid */
|
/* Reset: 0x0000h[28], default valid */
|
||||||
tmpV16 = rtw_read16(padapter, REG_SYS_FUNC_EN);
|
tmpV16 = rtw_read16(padapter, REG_SYS_FUNC_EN);
|
||||||
|
|
@ -643,25 +617,8 @@ void Hal_EfusePowerSwitch(
|
||||||
tmpV16 |= (LOADER_CLK_EN | ANA8M);
|
tmpV16 |= (LOADER_CLK_EN | ANA8M);
|
||||||
rtw_write16(padapter, REG_SYS_CLKR, tmpV16);
|
rtw_write16(padapter, REG_SYS_CLKR, tmpV16);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bWrite) {
|
|
||||||
/* Enable LDO 2.5V before read/write action */
|
|
||||||
tempval = rtw_read8(padapter, EFUSE_TEST+3);
|
|
||||||
tempval &= 0x0F;
|
|
||||||
tempval |= (VOLTAGE_V25 << 4);
|
|
||||||
rtw_write8(padapter, EFUSE_TEST+3, (tempval | 0x80));
|
|
||||||
|
|
||||||
/* rtw_write8(padapter, REG_EFUSE_ACCESS, EFUSE_ACCESS_ON); */
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
rtw_write8(padapter, REG_EFUSE_ACCESS, EFUSE_ACCESS_OFF);
|
rtw_write8(padapter, REG_EFUSE_ACCESS, EFUSE_ACCESS_OFF);
|
||||||
|
|
||||||
if (bWrite) {
|
|
||||||
/* Disable LDO 2.5V after read/write action */
|
|
||||||
tempval = rtw_read8(padapter, EFUSE_TEST+3);
|
|
||||||
rtw_write8(padapter, EFUSE_TEST+3, (tempval & 0x7F));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -669,14 +626,9 @@ static void hal_ReadEFuse_WiFi(
|
||||||
struct adapter *padapter,
|
struct adapter *padapter,
|
||||||
u16 _offset,
|
u16 _offset,
|
||||||
u16 _size_byte,
|
u16 _size_byte,
|
||||||
u8 *pbuf,
|
u8 *pbuf
|
||||||
bool bPseudoTest
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
#ifdef HAL_EFUSE_MEMORY
|
|
||||||
struct hal_com_data *pHalData = GET_HAL_DATA(padapter);
|
|
||||||
struct efuse_hal *pEfuseHal = &pHalData->EfuseHal;
|
|
||||||
#endif
|
|
||||||
u8 *efuseTbl = NULL;
|
u8 *efuseTbl = NULL;
|
||||||
u16 eFuse_Addr = 0;
|
u16 eFuse_Addr = 0;
|
||||||
u8 offset, wden;
|
u8 offset, wden;
|
||||||
|
|
@ -698,10 +650,10 @@ static void hal_ReadEFuse_WiFi(
|
||||||
memset(efuseTbl, 0xFF, EFUSE_MAX_MAP_LEN);
|
memset(efuseTbl, 0xFF, EFUSE_MAX_MAP_LEN);
|
||||||
|
|
||||||
/* switch bank back to bank 0 for later BT and wifi use. */
|
/* switch bank back to bank 0 for later BT and wifi use. */
|
||||||
hal_EfuseSwitchToBank(padapter, 0, bPseudoTest);
|
hal_EfuseSwitchToBank(padapter, 0);
|
||||||
|
|
||||||
while (AVAILABLE_EFUSE_ADDR(eFuse_Addr)) {
|
while (AVAILABLE_EFUSE_ADDR(eFuse_Addr)) {
|
||||||
efuse_OneByteRead(padapter, eFuse_Addr++, &efuseHeader, bPseudoTest);
|
efuse_OneByteRead(padapter, eFuse_Addr++, &efuseHeader);
|
||||||
if (efuseHeader == 0xFF)
|
if (efuseHeader == 0xFF)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
@ -709,7 +661,7 @@ static void hal_ReadEFuse_WiFi(
|
||||||
if (EXT_HEADER(efuseHeader)) { /* extended header */
|
if (EXT_HEADER(efuseHeader)) { /* extended header */
|
||||||
offset = GET_HDR_OFFSET_2_0(efuseHeader);
|
offset = GET_HDR_OFFSET_2_0(efuseHeader);
|
||||||
|
|
||||||
efuse_OneByteRead(padapter, eFuse_Addr++, &efuseExtHdr, bPseudoTest);
|
efuse_OneByteRead(padapter, eFuse_Addr++, &efuseExtHdr);
|
||||||
if (ALL_WORDS_DISABLED(efuseExtHdr))
|
if (ALL_WORDS_DISABLED(efuseExtHdr))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
@ -728,10 +680,10 @@ static void hal_ReadEFuse_WiFi(
|
||||||
for (i = 0; i < EFUSE_MAX_WORD_UNIT; i++) {
|
for (i = 0; i < EFUSE_MAX_WORD_UNIT; i++) {
|
||||||
/* Check word enable condition in the section */
|
/* Check word enable condition in the section */
|
||||||
if (!(wden & (0x01<<i))) {
|
if (!(wden & (0x01<<i))) {
|
||||||
efuse_OneByteRead(padapter, eFuse_Addr++, &efuseData, bPseudoTest);
|
efuse_OneByteRead(padapter, eFuse_Addr++, &efuseData);
|
||||||
efuseTbl[addr] = efuseData;
|
efuseTbl[addr] = efuseData;
|
||||||
|
|
||||||
efuse_OneByteRead(padapter, eFuse_Addr++, &efuseData, bPseudoTest);
|
efuse_OneByteRead(padapter, eFuse_Addr++, &efuseData);
|
||||||
efuseTbl[addr+1] = efuseData;
|
efuseTbl[addr+1] = efuseData;
|
||||||
}
|
}
|
||||||
addr += 2;
|
addr += 2;
|
||||||
|
|
@ -746,19 +698,12 @@ static void hal_ReadEFuse_WiFi(
|
||||||
pbuf[i] = efuseTbl[_offset+i];
|
pbuf[i] = efuseTbl[_offset+i];
|
||||||
|
|
||||||
/* Calculate Efuse utilization */
|
/* Calculate Efuse utilization */
|
||||||
EFUSE_GetEfuseDefinition(padapter, EFUSE_WIFI, TYPE_AVAILABLE_EFUSE_BYTES_TOTAL, &total, bPseudoTest);
|
Hal_GetEfuseDefinition(padapter, EFUSE_WIFI, TYPE_AVAILABLE_EFUSE_BYTES_TOTAL, &total);
|
||||||
used = eFuse_Addr - 1;
|
used = eFuse_Addr - 1;
|
||||||
efuse_usage = (u8)((used*100)/total);
|
efuse_usage = (u8)((used*100)/total);
|
||||||
if (bPseudoTest) {
|
|
||||||
#ifdef HAL_EFUSE_MEMORY
|
|
||||||
pEfuseHal->fakeEfuseUsedBytes = used;
|
|
||||||
#else
|
|
||||||
fakeEfuseUsedBytes = used;
|
|
||||||
#endif
|
|
||||||
} else {
|
|
||||||
rtw_hal_set_hwreg(padapter, HW_VAR_EFUSE_BYTES, (u8 *)&used);
|
rtw_hal_set_hwreg(padapter, HW_VAR_EFUSE_BYTES, (u8 *)&used);
|
||||||
rtw_hal_set_hwreg(padapter, HW_VAR_EFUSE_USAGE, (u8 *)&efuse_usage);
|
rtw_hal_set_hwreg(padapter, HW_VAR_EFUSE_USAGE, (u8 *)&efuse_usage);
|
||||||
}
|
|
||||||
|
|
||||||
kfree(efuseTbl);
|
kfree(efuseTbl);
|
||||||
}
|
}
|
||||||
|
|
@ -767,14 +712,9 @@ static void hal_ReadEFuse_BT(
|
||||||
struct adapter *padapter,
|
struct adapter *padapter,
|
||||||
u16 _offset,
|
u16 _offset,
|
||||||
u16 _size_byte,
|
u16 _size_byte,
|
||||||
u8 *pbuf,
|
u8 *pbuf
|
||||||
bool bPseudoTest
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
#ifdef HAL_EFUSE_MEMORY
|
|
||||||
struct hal_com_data *pHalData = GET_HAL_DATA(padapter);
|
|
||||||
struct efuse_hal *pEfuseHal = &pHalData->EfuseHal;
|
|
||||||
#endif
|
|
||||||
u8 *efuseTbl;
|
u8 *efuseTbl;
|
||||||
u8 bank;
|
u8 bank;
|
||||||
u16 eFuse_Addr;
|
u16 eFuse_Addr;
|
||||||
|
|
@ -797,16 +737,16 @@ static void hal_ReadEFuse_BT(
|
||||||
/* 0xff will be efuse default value instead of 0x00. */
|
/* 0xff will be efuse default value instead of 0x00. */
|
||||||
memset(efuseTbl, 0xFF, EFUSE_BT_MAP_LEN);
|
memset(efuseTbl, 0xFF, EFUSE_BT_MAP_LEN);
|
||||||
|
|
||||||
EFUSE_GetEfuseDefinition(padapter, EFUSE_BT, TYPE_AVAILABLE_EFUSE_BYTES_BANK, &total, bPseudoTest);
|
Hal_GetEfuseDefinition(padapter, EFUSE_BT, TYPE_AVAILABLE_EFUSE_BYTES_BANK, &total);
|
||||||
|
|
||||||
for (bank = 1; bank < 3; bank++) { /* 8723b Max bake 0~2 */
|
for (bank = 1; bank < 3; bank++) { /* 8723b Max bake 0~2 */
|
||||||
if (hal_EfuseSwitchToBank(padapter, bank, bPseudoTest) == false)
|
if (hal_EfuseSwitchToBank(padapter, bank) == false)
|
||||||
goto exit;
|
goto exit;
|
||||||
|
|
||||||
eFuse_Addr = 0;
|
eFuse_Addr = 0;
|
||||||
|
|
||||||
while (AVAILABLE_EFUSE_ADDR(eFuse_Addr)) {
|
while (AVAILABLE_EFUSE_ADDR(eFuse_Addr)) {
|
||||||
efuse_OneByteRead(padapter, eFuse_Addr++, &efuseHeader, bPseudoTest);
|
efuse_OneByteRead(padapter, eFuse_Addr++, &efuseHeader);
|
||||||
if (efuseHeader == 0xFF)
|
if (efuseHeader == 0xFF)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
@ -814,7 +754,7 @@ static void hal_ReadEFuse_BT(
|
||||||
if (EXT_HEADER(efuseHeader)) { /* extended header */
|
if (EXT_HEADER(efuseHeader)) { /* extended header */
|
||||||
offset = GET_HDR_OFFSET_2_0(efuseHeader);
|
offset = GET_HDR_OFFSET_2_0(efuseHeader);
|
||||||
|
|
||||||
efuse_OneByteRead(padapter, eFuse_Addr++, &efuseExtHdr, bPseudoTest);
|
efuse_OneByteRead(padapter, eFuse_Addr++, &efuseExtHdr);
|
||||||
if (ALL_WORDS_DISABLED(efuseExtHdr))
|
if (ALL_WORDS_DISABLED(efuseExtHdr))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
@ -832,10 +772,10 @@ static void hal_ReadEFuse_BT(
|
||||||
for (i = 0; i < EFUSE_MAX_WORD_UNIT; i++) {
|
for (i = 0; i < EFUSE_MAX_WORD_UNIT; i++) {
|
||||||
/* Check word enable condition in the section */
|
/* Check word enable condition in the section */
|
||||||
if (!(wden & (0x01<<i))) {
|
if (!(wden & (0x01<<i))) {
|
||||||
efuse_OneByteRead(padapter, eFuse_Addr++, &efuseData, bPseudoTest);
|
efuse_OneByteRead(padapter, eFuse_Addr++, &efuseData);
|
||||||
efuseTbl[addr] = efuseData;
|
efuseTbl[addr] = efuseData;
|
||||||
|
|
||||||
efuse_OneByteRead(padapter, eFuse_Addr++, &efuseData, bPseudoTest);
|
efuse_OneByteRead(padapter, eFuse_Addr++, &efuseData);
|
||||||
efuseTbl[addr+1] = efuseData;
|
efuseTbl[addr+1] = efuseData;
|
||||||
}
|
}
|
||||||
addr += 2;
|
addr += 2;
|
||||||
|
|
@ -851,7 +791,7 @@ static void hal_ReadEFuse_BT(
|
||||||
}
|
}
|
||||||
|
|
||||||
/* switch bank back to bank 0 for later BT and wifi use. */
|
/* switch bank back to bank 0 for later BT and wifi use. */
|
||||||
hal_EfuseSwitchToBank(padapter, 0, bPseudoTest);
|
hal_EfuseSwitchToBank(padapter, 0);
|
||||||
|
|
||||||
/* Copy from Efuse map to output pointer memory!!! */
|
/* Copy from Efuse map to output pointer memory!!! */
|
||||||
for (i = 0; i < _size_byte; i++)
|
for (i = 0; i < _size_byte; i++)
|
||||||
|
|
@ -860,19 +800,12 @@ static void hal_ReadEFuse_BT(
|
||||||
/* */
|
/* */
|
||||||
/* Calculate Efuse utilization. */
|
/* Calculate Efuse utilization. */
|
||||||
/* */
|
/* */
|
||||||
EFUSE_GetEfuseDefinition(padapter, EFUSE_BT, TYPE_AVAILABLE_EFUSE_BYTES_TOTAL, &total, bPseudoTest);
|
Hal_GetEfuseDefinition(padapter, EFUSE_BT, TYPE_AVAILABLE_EFUSE_BYTES_TOTAL, &total);
|
||||||
used = (EFUSE_BT_REAL_BANK_CONTENT_LEN*(bank-1)) + eFuse_Addr - 1;
|
used = (EFUSE_BT_REAL_BANK_CONTENT_LEN*(bank-1)) + eFuse_Addr - 1;
|
||||||
efuse_usage = (u8)((used*100)/total);
|
efuse_usage = (u8)((used*100)/total);
|
||||||
if (bPseudoTest) {
|
|
||||||
#ifdef HAL_EFUSE_MEMORY
|
|
||||||
pEfuseHal->fakeBTEfuseUsedBytes = used;
|
|
||||||
#else
|
|
||||||
fakeBTEfuseUsedBytes = used;
|
|
||||||
#endif
|
|
||||||
} else {
|
|
||||||
rtw_hal_set_hwreg(padapter, HW_VAR_EFUSE_BT_BYTES, (u8 *)&used);
|
rtw_hal_set_hwreg(padapter, HW_VAR_EFUSE_BT_BYTES, (u8 *)&used);
|
||||||
rtw_hal_set_hwreg(padapter, HW_VAR_EFUSE_BT_USAGE, (u8 *)&efuse_usage);
|
rtw_hal_set_hwreg(padapter, HW_VAR_EFUSE_BT_USAGE, (u8 *)&efuse_usage);
|
||||||
}
|
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
kfree(efuseTbl);
|
kfree(efuseTbl);
|
||||||
|
|
@ -883,198 +816,13 @@ void Hal_ReadEFuse(
|
||||||
u8 efuseType,
|
u8 efuseType,
|
||||||
u16 _offset,
|
u16 _offset,
|
||||||
u16 _size_byte,
|
u16 _size_byte,
|
||||||
u8 *pbuf,
|
u8 *pbuf
|
||||||
bool bPseudoTest
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (efuseType == EFUSE_WIFI)
|
if (efuseType == EFUSE_WIFI)
|
||||||
hal_ReadEFuse_WiFi(padapter, _offset, _size_byte, pbuf, bPseudoTest);
|
hal_ReadEFuse_WiFi(padapter, _offset, _size_byte, pbuf);
|
||||||
else
|
else
|
||||||
hal_ReadEFuse_BT(padapter, _offset, _size_byte, pbuf, bPseudoTest);
|
hal_ReadEFuse_BT(padapter, _offset, _size_byte, pbuf);
|
||||||
}
|
|
||||||
|
|
||||||
static u16 hal_EfuseGetCurrentSize_WiFi(
|
|
||||||
struct adapter *padapter, bool bPseudoTest
|
|
||||||
)
|
|
||||||
{
|
|
||||||
#ifdef HAL_EFUSE_MEMORY
|
|
||||||
struct hal_com_data *pHalData = GET_HAL_DATA(padapter);
|
|
||||||
struct efuse_hal *pEfuseHal = &pHalData->EfuseHal;
|
|
||||||
#endif
|
|
||||||
u16 efuse_addr = 0;
|
|
||||||
u16 start_addr = 0; /* for debug */
|
|
||||||
u8 hworden = 0;
|
|
||||||
u8 efuse_data, word_cnts = 0;
|
|
||||||
u32 count = 0; /* for debug */
|
|
||||||
|
|
||||||
|
|
||||||
if (bPseudoTest) {
|
|
||||||
#ifdef HAL_EFUSE_MEMORY
|
|
||||||
efuse_addr = (u16)pEfuseHal->fakeEfuseUsedBytes;
|
|
||||||
#else
|
|
||||||
efuse_addr = (u16)fakeEfuseUsedBytes;
|
|
||||||
#endif
|
|
||||||
} else
|
|
||||||
rtw_hal_get_hwreg(padapter, HW_VAR_EFUSE_BYTES, (u8 *)&efuse_addr);
|
|
||||||
|
|
||||||
start_addr = efuse_addr;
|
|
||||||
|
|
||||||
/* switch bank back to bank 0 for later BT and wifi use. */
|
|
||||||
hal_EfuseSwitchToBank(padapter, 0, bPseudoTest);
|
|
||||||
|
|
||||||
count = 0;
|
|
||||||
while (AVAILABLE_EFUSE_ADDR(efuse_addr)) {
|
|
||||||
if (efuse_OneByteRead(padapter, efuse_addr, &efuse_data, bPseudoTest) == false)
|
|
||||||
goto error;
|
|
||||||
|
|
||||||
if (efuse_data == 0xFF)
|
|
||||||
break;
|
|
||||||
|
|
||||||
if ((start_addr != 0) && (efuse_addr == start_addr)) {
|
|
||||||
count++;
|
|
||||||
|
|
||||||
efuse_data = 0xFF;
|
|
||||||
if (count < 4) {
|
|
||||||
/* try again! */
|
|
||||||
|
|
||||||
if (count > 2) {
|
|
||||||
/* try again form address 0 */
|
|
||||||
efuse_addr = 0;
|
|
||||||
start_addr = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (EXT_HEADER(efuse_data)) {
|
|
||||||
efuse_addr++;
|
|
||||||
efuse_OneByteRead(padapter, efuse_addr, &efuse_data, bPseudoTest);
|
|
||||||
if (ALL_WORDS_DISABLED(efuse_data))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
hworden = efuse_data & 0x0F;
|
|
||||||
} else {
|
|
||||||
hworden = efuse_data & 0x0F;
|
|
||||||
}
|
|
||||||
|
|
||||||
word_cnts = Efuse_CalculateWordCnts(hworden);
|
|
||||||
efuse_addr += (word_cnts*2)+1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (bPseudoTest) {
|
|
||||||
#ifdef HAL_EFUSE_MEMORY
|
|
||||||
pEfuseHal->fakeEfuseUsedBytes = efuse_addr;
|
|
||||||
#else
|
|
||||||
fakeEfuseUsedBytes = efuse_addr;
|
|
||||||
#endif
|
|
||||||
} else
|
|
||||||
rtw_hal_set_hwreg(padapter, HW_VAR_EFUSE_BYTES, (u8 *)&efuse_addr);
|
|
||||||
|
|
||||||
goto exit;
|
|
||||||
|
|
||||||
error:
|
|
||||||
/* report max size to prevent write efuse */
|
|
||||||
EFUSE_GetEfuseDefinition(padapter, EFUSE_WIFI, TYPE_AVAILABLE_EFUSE_BYTES_TOTAL, &efuse_addr, bPseudoTest);
|
|
||||||
|
|
||||||
exit:
|
|
||||||
|
|
||||||
return efuse_addr;
|
|
||||||
}
|
|
||||||
|
|
||||||
static u16 hal_EfuseGetCurrentSize_BT(struct adapter *padapter, u8 bPseudoTest)
|
|
||||||
{
|
|
||||||
#ifdef HAL_EFUSE_MEMORY
|
|
||||||
struct hal_com_data *pHalData = GET_HAL_DATA(padapter);
|
|
||||||
struct efuse_hal *pEfuseHal = &pHalData->EfuseHal;
|
|
||||||
#endif
|
|
||||||
u16 btusedbytes;
|
|
||||||
u16 efuse_addr;
|
|
||||||
u8 bank, startBank;
|
|
||||||
u8 hworden = 0;
|
|
||||||
u8 efuse_data, word_cnts = 0;
|
|
||||||
u16 retU2 = 0;
|
|
||||||
|
|
||||||
if (bPseudoTest) {
|
|
||||||
#ifdef HAL_EFUSE_MEMORY
|
|
||||||
btusedbytes = pEfuseHal->fakeBTEfuseUsedBytes;
|
|
||||||
#else
|
|
||||||
btusedbytes = fakeBTEfuseUsedBytes;
|
|
||||||
#endif
|
|
||||||
} else
|
|
||||||
rtw_hal_get_hwreg(padapter, HW_VAR_EFUSE_BT_BYTES, (u8 *)&btusedbytes);
|
|
||||||
|
|
||||||
efuse_addr = (u16)((btusedbytes%EFUSE_BT_REAL_BANK_CONTENT_LEN));
|
|
||||||
startBank = (u8)(1+(btusedbytes/EFUSE_BT_REAL_BANK_CONTENT_LEN));
|
|
||||||
|
|
||||||
EFUSE_GetEfuseDefinition(padapter, EFUSE_BT, TYPE_AVAILABLE_EFUSE_BYTES_BANK, &retU2, bPseudoTest);
|
|
||||||
|
|
||||||
for (bank = startBank; bank < 3; bank++) {
|
|
||||||
if (hal_EfuseSwitchToBank(padapter, bank, bPseudoTest) == false)
|
|
||||||
/* bank = EFUSE_MAX_BANK; */
|
|
||||||
break;
|
|
||||||
|
|
||||||
/* only when bank is switched we have to reset the efuse_addr. */
|
|
||||||
if (bank != startBank)
|
|
||||||
efuse_addr = 0;
|
|
||||||
|
|
||||||
while (AVAILABLE_EFUSE_ADDR(efuse_addr)) {
|
|
||||||
if (efuse_OneByteRead(padapter, efuse_addr,
|
|
||||||
&efuse_data, bPseudoTest) == false)
|
|
||||||
/* bank = EFUSE_MAX_BANK; */
|
|
||||||
break;
|
|
||||||
|
|
||||||
if (efuse_data == 0xFF)
|
|
||||||
break;
|
|
||||||
|
|
||||||
if (EXT_HEADER(efuse_data)) {
|
|
||||||
efuse_addr++;
|
|
||||||
efuse_OneByteRead(padapter, efuse_addr, &efuse_data, bPseudoTest);
|
|
||||||
|
|
||||||
if (ALL_WORDS_DISABLED(efuse_data)) {
|
|
||||||
efuse_addr++;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
hworden = efuse_data & 0x0F;
|
|
||||||
} else {
|
|
||||||
hworden = efuse_data & 0x0F;
|
|
||||||
}
|
|
||||||
|
|
||||||
word_cnts = Efuse_CalculateWordCnts(hworden);
|
|
||||||
/* read next header */
|
|
||||||
efuse_addr += (word_cnts*2)+1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Check if we need to check next bank efuse */
|
|
||||||
if (efuse_addr < retU2)
|
|
||||||
break; /* don't need to check next bank. */
|
|
||||||
}
|
|
||||||
|
|
||||||
retU2 = ((bank-1)*EFUSE_BT_REAL_BANK_CONTENT_LEN)+efuse_addr;
|
|
||||||
if (bPseudoTest) {
|
|
||||||
pEfuseHal->fakeBTEfuseUsedBytes = retU2;
|
|
||||||
} else {
|
|
||||||
pEfuseHal->BTEfuseUsedBytes = retU2;
|
|
||||||
}
|
|
||||||
|
|
||||||
return retU2;
|
|
||||||
}
|
|
||||||
|
|
||||||
u16 Hal_EfuseGetCurrentSize(
|
|
||||||
struct adapter *padapter, u8 efuseType, bool bPseudoTest
|
|
||||||
)
|
|
||||||
{
|
|
||||||
u16 ret = 0;
|
|
||||||
|
|
||||||
if (efuseType == EFUSE_WIFI)
|
|
||||||
ret = hal_EfuseGetCurrentSize_WiFi(padapter, bPseudoTest);
|
|
||||||
else
|
|
||||||
ret = hal_EfuseGetCurrentSize_BT(padapter, bPseudoTest);
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct hal_version ReadChipVersion8723B(struct adapter *padapter)
|
static struct hal_version ReadChipVersion8723B(struct adapter *padapter)
|
||||||
|
|
@ -1438,12 +1186,12 @@ void Hal_InitPGData(struct adapter *padapter, u8 *PROMContent)
|
||||||
if (!pEEPROM->bautoload_fail_flag) { /* autoload OK. */
|
if (!pEEPROM->bautoload_fail_flag) { /* autoload OK. */
|
||||||
if (!pEEPROM->EepromOrEfuse) {
|
if (!pEEPROM->EepromOrEfuse) {
|
||||||
/* Read EFUSE real map to shadow. */
|
/* Read EFUSE real map to shadow. */
|
||||||
EFUSE_ShadowMapUpdate(padapter, EFUSE_WIFI, false);
|
EFUSE_ShadowMapUpdate(padapter, EFUSE_WIFI);
|
||||||
memcpy((void *)PROMContent, (void *)pEEPROM->efuse_eeprom_data, HWSET_MAX_SIZE_8723B);
|
memcpy((void *)PROMContent, (void *)pEEPROM->efuse_eeprom_data, HWSET_MAX_SIZE_8723B);
|
||||||
}
|
}
|
||||||
} else {/* autoload fail */
|
} else {/* autoload fail */
|
||||||
if (!pEEPROM->EepromOrEfuse)
|
if (!pEEPROM->EepromOrEfuse)
|
||||||
EFUSE_ShadowMapUpdate(padapter, EFUSE_WIFI, false);
|
EFUSE_ShadowMapUpdate(padapter, EFUSE_WIFI);
|
||||||
memcpy((void *)PROMContent, (void *)pEEPROM->efuse_eeprom_data, HWSET_MAX_SIZE_8723B);
|
memcpy((void *)PROMContent, (void *)pEEPROM->efuse_eeprom_data, HWSET_MAX_SIZE_8723B);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1700,9 +1448,9 @@ void Hal_EfuseParsePackageType_8723B(
|
||||||
u8 package;
|
u8 package;
|
||||||
u8 efuseContent;
|
u8 efuseContent;
|
||||||
|
|
||||||
Efuse_PowerSwitch(padapter, false, true);
|
Hal_EfusePowerSwitch(padapter, true);
|
||||||
efuse_OneByteRead(padapter, 0x1FB, &efuseContent, false);
|
efuse_OneByteRead(padapter, 0x1FB, &efuseContent);
|
||||||
Efuse_PowerSwitch(padapter, false, false);
|
Hal_EfusePowerSwitch(padapter, false);
|
||||||
|
|
||||||
package = efuseContent & 0x7;
|
package = efuseContent & 0x7;
|
||||||
switch (package) {
|
switch (package) {
|
||||||
|
|
@ -1763,14 +1511,6 @@ void Hal_EfuseParseCustomerID_8723B(
|
||||||
pHalData->EEPROMCustomerID = 0;
|
pHalData->EEPROMCustomerID = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Hal_EfuseParseAntennaDiversity_8723B(
|
|
||||||
struct adapter *padapter,
|
|
||||||
u8 *hwinfo,
|
|
||||||
bool AutoLoadFail
|
|
||||||
)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void Hal_EfuseParseXtal_8723B(
|
void Hal_EfuseParseXtal_8723B(
|
||||||
struct adapter *padapter, u8 *hwinfo, bool AutoLoadFail
|
struct adapter *padapter, u8 *hwinfo, bool AutoLoadFail
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -431,7 +431,8 @@ s32 rtl8723bs_init_recv_priv(struct adapter *padapter)
|
||||||
precvpriv->free_recv_buf_queue_cnt = 0;
|
precvpriv->free_recv_buf_queue_cnt = 0;
|
||||||
for (i = 0; i < n ; i++) {
|
for (i = 0; i < n ; i++) {
|
||||||
list_del_init(&precvbuf->list);
|
list_del_init(&precvbuf->list);
|
||||||
rtw_os_recvbuf_resource_free(padapter, precvbuf);
|
if (precvbuf->pskb)
|
||||||
|
dev_kfree_skb_any(precvbuf->pskb);
|
||||||
precvbuf++;
|
precvbuf++;
|
||||||
}
|
}
|
||||||
precvpriv->precv_buf = NULL;
|
precvpriv->precv_buf = NULL;
|
||||||
|
|
@ -467,7 +468,8 @@ void rtl8723bs_free_recv_priv(struct adapter *padapter)
|
||||||
precvpriv->free_recv_buf_queue_cnt = 0;
|
precvpriv->free_recv_buf_queue_cnt = 0;
|
||||||
for (i = 0; i < NR_RECVBUFF; i++) {
|
for (i = 0; i < NR_RECVBUFF; i++) {
|
||||||
list_del_init(&precvbuf->list);
|
list_del_init(&precvbuf->list);
|
||||||
rtw_os_recvbuf_resource_free(padapter, precvbuf);
|
if (precvbuf->pskb)
|
||||||
|
dev_kfree_skb_any(precvbuf->pskb);
|
||||||
precvbuf++;
|
precvbuf++;
|
||||||
}
|
}
|
||||||
precvpriv->precv_buf = NULL;
|
precvpriv->precv_buf = NULL;
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ static s32 rtl8723_dequeue_writeport(struct adapter *padapter)
|
||||||
/* check if hardware tx fifo page is enough */
|
/* check if hardware tx fifo page is enough */
|
||||||
if (!rtw_hal_sdio_query_tx_freepage(pri_padapter, PageIdx, pxmitbuf->pg_num)) {
|
if (!rtw_hal_sdio_query_tx_freepage(pri_padapter, PageIdx, pxmitbuf->pg_num)) {
|
||||||
if (!bUpdatePageNum) {
|
if (!bUpdatePageNum) {
|
||||||
/* Total number of page is NOT available, so update current FIFO status */
|
/* Total page count is not available, so update current FIFO status */
|
||||||
HalQueryTxBufferStatus8723BSdio(padapter);
|
HalQueryTxBufferStatus8723BSdio(padapter);
|
||||||
bUpdatePageNum = true;
|
bUpdatePageNum = true;
|
||||||
goto query_free_page;
|
goto query_free_page;
|
||||||
|
|
|
||||||
|
|
@ -1071,7 +1071,6 @@ static void _ReadEfuseInfo8723BS(struct adapter *padapter)
|
||||||
Hal_EfuseParseChnlPlan_8723B(padapter, hwinfo, pEEPROM->bautoload_fail_flag);
|
Hal_EfuseParseChnlPlan_8723B(padapter, hwinfo, pEEPROM->bautoload_fail_flag);
|
||||||
Hal_EfuseParseXtal_8723B(padapter, hwinfo, pEEPROM->bautoload_fail_flag);
|
Hal_EfuseParseXtal_8723B(padapter, hwinfo, pEEPROM->bautoload_fail_flag);
|
||||||
Hal_EfuseParseThermalMeter_8723B(padapter, hwinfo, pEEPROM->bautoload_fail_flag);
|
Hal_EfuseParseThermalMeter_8723B(padapter, hwinfo, pEEPROM->bautoload_fail_flag);
|
||||||
Hal_EfuseParseAntennaDiversity_8723B(padapter, hwinfo, pEEPROM->bautoload_fail_flag);
|
|
||||||
Hal_EfuseParseCustomerID_8723B(padapter, hwinfo, pEEPROM->bautoload_fail_flag);
|
Hal_EfuseParseCustomerID_8723B(padapter, hwinfo, pEEPROM->bautoload_fail_flag);
|
||||||
|
|
||||||
Hal_EfuseParseVoltage_8723B(padapter, hwinfo, pEEPROM->bautoload_fail_flag);
|
Hal_EfuseParseVoltage_8723B(padapter, hwinfo, pEEPROM->bautoload_fail_flag);
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,8 @@
|
||||||
(*((u32 *)(_ptr))) = EF2BYTE(_val); \
|
(*((u32 *)(_ptr))) = EF2BYTE(_val); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
/* Create a bit mask
|
/*
|
||||||
|
* Create a bit mask
|
||||||
* Examples:
|
* Examples:
|
||||||
* BIT_LEN_MASK_32(0) => 0x00000000
|
* BIT_LEN_MASK_32(0) => 0x00000000
|
||||||
* BIT_LEN_MASK_32(1) => 0x00000001
|
* BIT_LEN_MASK_32(1) => 0x00000001
|
||||||
|
|
@ -82,7 +83,8 @@
|
||||||
#define BIT_LEN_MASK_8(__bitlen) \
|
#define BIT_LEN_MASK_8(__bitlen) \
|
||||||
(0xFF >> (8 - (__bitlen)))
|
(0xFF >> (8 - (__bitlen)))
|
||||||
|
|
||||||
/* Create an offset bit mask
|
/*
|
||||||
|
* Create an offset bit mask
|
||||||
* Examples:
|
* Examples:
|
||||||
* BIT_OFFSET_LEN_MASK_32(0, 2) => 0x00000003
|
* BIT_OFFSET_LEN_MASK_32(0, 2) => 0x00000003
|
||||||
* BIT_OFFSET_LEN_MASK_32(16, 2) => 0x00030000
|
* BIT_OFFSET_LEN_MASK_32(16, 2) => 0x00030000
|
||||||
|
|
@ -94,7 +96,8 @@
|
||||||
#define BIT_OFFSET_LEN_MASK_8(__bitoffset, __bitlen) \
|
#define BIT_OFFSET_LEN_MASK_8(__bitoffset, __bitlen) \
|
||||||
(BIT_LEN_MASK_8(__bitlen) << (__bitoffset))
|
(BIT_LEN_MASK_8(__bitlen) << (__bitoffset))
|
||||||
|
|
||||||
/*Description:
|
/*
|
||||||
|
* Description:
|
||||||
* Return 4-byte value in host byte ordering from
|
* Return 4-byte value in host byte ordering from
|
||||||
* 4-byte pointer in little-endian system.
|
* 4-byte pointer in little-endian system.
|
||||||
*/
|
*/
|
||||||
|
|
@ -105,11 +108,11 @@
|
||||||
#define LE_P1BYTE_TO_HOST_1BYTE(__pstart) \
|
#define LE_P1BYTE_TO_HOST_1BYTE(__pstart) \
|
||||||
(EF1BYTE(*((u8 *)(__pstart))))
|
(EF1BYTE(*((u8 *)(__pstart))))
|
||||||
|
|
||||||
/* */
|
/*
|
||||||
/* Description: */
|
* Description:
|
||||||
/* Translate subfield (continuous bits in little-endian) of 4-byte value in litten byte to */
|
* Translate subfield (continuous bits in little-endian) of 4-byte value in
|
||||||
/* 4-byte value in host byte ordering. */
|
* little byte to 4-byte value in host byte ordering.
|
||||||
/* */
|
*/
|
||||||
#define LE_BITS_TO_4BYTE(__pstart, __bitoffset, __bitlen) \
|
#define LE_BITS_TO_4BYTE(__pstart, __bitoffset, __bitlen) \
|
||||||
(\
|
(\
|
||||||
(LE_P4BYTE_TO_HOST_4BYTE(__pstart) >> (__bitoffset)) & \
|
(LE_P4BYTE_TO_HOST_4BYTE(__pstart) >> (__bitoffset)) & \
|
||||||
|
|
@ -126,11 +129,11 @@
|
||||||
BIT_LEN_MASK_8(__bitlen) \
|
BIT_LEN_MASK_8(__bitlen) \
|
||||||
)
|
)
|
||||||
|
|
||||||
/* */
|
/*
|
||||||
/* Description: */
|
* Description:
|
||||||
/* Mask subfield (continuous bits in little-endian) of 4-byte value in litten byte oredering */
|
* Mask subfield (continuous bits in little-endian) of 4-byte value in little
|
||||||
/* and return the result in 4-byte value in host byte ordering. */
|
* byte ordering and return the result in 4-byte value in host byte ordering.
|
||||||
/* */
|
*/
|
||||||
#define LE_BITS_CLEARED_TO_4BYTE(__pstart, __bitoffset, __bitlen) \
|
#define LE_BITS_CLEARED_TO_4BYTE(__pstart, __bitoffset, __bitlen) \
|
||||||
(\
|
(\
|
||||||
LE_P4BYTE_TO_HOST_4BYTE(__pstart) & \
|
LE_P4BYTE_TO_HOST_4BYTE(__pstart) & \
|
||||||
|
|
@ -147,10 +150,10 @@
|
||||||
(~BIT_OFFSET_LEN_MASK_8(__bitoffset, __bitlen)) \
|
(~BIT_OFFSET_LEN_MASK_8(__bitoffset, __bitlen)) \
|
||||||
)
|
)
|
||||||
|
|
||||||
/* */
|
/*
|
||||||
/* Description: */
|
* Description:
|
||||||
/* Set subfield of little-endian 4-byte value to specified value. */
|
* Set subfield of little-endian 4-byte value to specified value.
|
||||||
/* */
|
*/
|
||||||
#define SET_BITS_TO_LE_4BYTE(__pstart, __bitoffset, __bitlen, __val) \
|
#define SET_BITS_TO_LE_4BYTE(__pstart, __bitoffset, __bitlen, __val) \
|
||||||
*((u32 *)(__pstart)) = \
|
*((u32 *)(__pstart)) = \
|
||||||
( \
|
( \
|
||||||
|
|
|
||||||
|
|
@ -33,14 +33,12 @@
|
||||||
#include <xmit_osdep.h>
|
#include <xmit_osdep.h>
|
||||||
#include <rtw_recv.h>
|
#include <rtw_recv.h>
|
||||||
|
|
||||||
#include <recv_osdep.h>
|
|
||||||
#include <rtw_efuse.h>
|
#include <rtw_efuse.h>
|
||||||
#include <hal_intf.h>
|
#include <hal_intf.h>
|
||||||
#include <hal_com.h>
|
#include <hal_com.h>
|
||||||
#include <rtw_qos.h>
|
#include <rtw_qos.h>
|
||||||
#include <rtw_pwrctrl.h>
|
#include <rtw_pwrctrl.h>
|
||||||
#include <rtw_mlme.h>
|
#include <rtw_mlme.h>
|
||||||
#include <mlme_osdep.h>
|
|
||||||
#include <rtw_io.h>
|
#include <rtw_io.h>
|
||||||
#include <rtw_ioctl_set.h>
|
#include <rtw_ioctl_set.h>
|
||||||
#include <osdep_intf.h>
|
#include <osdep_intf.h>
|
||||||
|
|
|
||||||
|
|
@ -265,11 +265,10 @@ u8 GetHalDefVar8723BSDIO(struct adapter *Adapter, enum hal_def_variable eVariabl
|
||||||
u8 SetHalDefVar8723BSDIO(struct adapter *Adapter, enum hal_def_variable eVariable, void *pValue);
|
u8 SetHalDefVar8723BSDIO(struct adapter *Adapter, enum hal_def_variable eVariable, void *pValue);
|
||||||
void UpdateHalRAMask8723B(struct adapter *padapter, u32 mac_id, u8 rssi_level);
|
void UpdateHalRAMask8723B(struct adapter *padapter, u32 mac_id, u8 rssi_level);
|
||||||
void rtl8723b_SetBeaconRelatedRegisters(struct adapter *padapter);
|
void rtl8723b_SetBeaconRelatedRegisters(struct adapter *padapter);
|
||||||
void Hal_EfusePowerSwitch(struct adapter *padapter, u8 bWrite, u8 PwrState);
|
void Hal_EfusePowerSwitch(struct adapter *padapter, u8 PwrState);
|
||||||
void Hal_ReadEFuse(struct adapter *padapter, u8 efuseType, u16 _offset,
|
void Hal_ReadEFuse(struct adapter *padapter, u8 efuseType, u16 _offset,
|
||||||
u16 _size_byte, u8 *pbuf, bool bPseudoTest);
|
u16 _size_byte, u8 *pbuf);
|
||||||
void Hal_GetEfuseDefinition(struct adapter *padapter, u8 efuseType, u8 type,
|
void Hal_GetEfuseDefinition(struct adapter *padapter, u8 efuseType, u8 type,
|
||||||
void *pOut, bool bPseudoTest);
|
void *pOut);
|
||||||
u16 Hal_EfuseGetCurrentSize(struct adapter *padapter, u8 efuseType, bool bPseudoTest);
|
|
||||||
void hal_notch_filter_8723b(struct adapter *adapter, bool enable);
|
void hal_notch_filter_8723b(struct adapter *adapter, bool enable);
|
||||||
#endif /* __HAL_INTF_H__ */
|
#endif /* __HAL_INTF_H__ */
|
||||||
|
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
||||||
/* SPDX-License-Identifier: GPL-2.0 */
|
|
||||||
/******************************************************************************
|
|
||||||
*
|
|
||||||
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
|
|
||||||
*
|
|
||||||
******************************************************************************/
|
|
||||||
#ifndef __MLME_OSDEP_H_
|
|
||||||
#define __MLME_OSDEP_H_
|
|
||||||
|
|
||||||
|
|
||||||
extern void rtw_init_mlme_timer(struct adapter *padapter);
|
|
||||||
extern void rtw_os_indicate_disconnect(struct adapter *adapter);
|
|
||||||
extern void rtw_os_indicate_connect(struct adapter *adapter);
|
|
||||||
void rtw_os_indicate_scan_done(struct adapter *padapter, bool aborted);
|
|
||||||
extern void rtw_report_sec_ie(struct adapter *adapter, u8 authmode, u8 *sec_ie);
|
|
||||||
|
|
||||||
void rtw_reset_securitypriv(struct adapter *adapter);
|
|
||||||
|
|
||||||
#endif /* _MLME_OSDEP_H_ */
|
|
||||||
|
|
@ -1,40 +0,0 @@
|
||||||
/* SPDX-License-Identifier: GPL-2.0 */
|
|
||||||
/******************************************************************************
|
|
||||||
*
|
|
||||||
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
|
|
||||||
*
|
|
||||||
******************************************************************************/
|
|
||||||
#ifndef __RECV_OSDEP_H_
|
|
||||||
#define __RECV_OSDEP_H_
|
|
||||||
|
|
||||||
|
|
||||||
extern signed int _rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *padapter);
|
|
||||||
extern void _rtw_free_recv_priv(struct recv_priv *precvpriv);
|
|
||||||
|
|
||||||
|
|
||||||
extern s32 rtw_recv_entry(union recv_frame *precv_frame);
|
|
||||||
extern int rtw_recv_indicatepkt(struct adapter *adapter, union recv_frame *precv_frame);
|
|
||||||
extern void rtw_recv_returnpacket(struct net_device *cnxt, struct sk_buff *preturnedpkt);
|
|
||||||
|
|
||||||
extern 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);
|
|
||||||
|
|
||||||
|
|
||||||
void rtw_os_recv_resource_alloc(struct adapter *padapter, union recv_frame *precvframe);
|
|
||||||
void rtw_os_recv_resource_free(struct recv_priv *precvpriv);
|
|
||||||
|
|
||||||
|
|
||||||
void rtw_os_free_recvframe(union recv_frame *precvframe);
|
|
||||||
|
|
||||||
|
|
||||||
void rtw_os_recvbuf_resource_free(struct adapter *padapter, struct recv_buf *precvbuf);
|
|
||||||
|
|
||||||
struct sk_buff *rtw_os_alloc_msdu_pkt(union recv_frame *prframe, u16 nSubframe_Length, u8 *pdata);
|
|
||||||
void rtw_os_recv_indicate_pkt(struct adapter *padapter, struct sk_buff *pkt, struct rx_pkt_attrib *pattrib);
|
|
||||||
|
|
||||||
void rtw_init_recv_timer(struct recv_reorder_ctrl *preorder_ctrl);
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* */
|
|
||||||
|
|
@ -210,8 +210,6 @@ void Hal_EfuseParseChnlPlan_8723B(struct adapter *padapter, u8 *hwinfo,
|
||||||
bool AutoLoadFail);
|
bool AutoLoadFail);
|
||||||
void Hal_EfuseParseCustomerID_8723B(struct adapter *padapter, u8 *hwinfo,
|
void Hal_EfuseParseCustomerID_8723B(struct adapter *padapter, u8 *hwinfo,
|
||||||
bool AutoLoadFail);
|
bool AutoLoadFail);
|
||||||
void Hal_EfuseParseAntennaDiversity_8723B(struct adapter *padapter, u8 *hwinfo,
|
|
||||||
bool AutoLoadFail);
|
|
||||||
void Hal_EfuseParseXtal_8723B(struct adapter *padapter, u8 *hwinfo,
|
void Hal_EfuseParseXtal_8723B(struct adapter *padapter, u8 *hwinfo,
|
||||||
bool AutoLoadFail);
|
bool AutoLoadFail);
|
||||||
void Hal_EfuseParseThermalMeter_8723B(struct adapter *padapter, u8 *hwinfo,
|
void Hal_EfuseParseThermalMeter_8723B(struct adapter *padapter, u8 *hwinfo,
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,6 @@
|
||||||
/* SPDX-License-Identifier: GPL-2.0 */
|
/* SPDX-License-Identifier: GPL-2.0 */
|
||||||
/******************************************************************************
|
/* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. */
|
||||||
*
|
|
||||||
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
|
|
||||||
*
|
|
||||||
******************************************************************************/
|
|
||||||
#ifndef __RTW_EFUSE_H__
|
#ifndef __RTW_EFUSE_H__
|
||||||
#define __RTW_EFUSE_H__
|
#define __RTW_EFUSE_H__
|
||||||
|
|
||||||
|
|
@ -91,14 +88,10 @@ extern u8 fakeBTEfuseModifiedMap[];
|
||||||
/*------------------------Export global variable----------------------------*/
|
/*------------------------Export global variable----------------------------*/
|
||||||
|
|
||||||
u8 Efuse_CalculateWordCnts(u8 word_en);
|
u8 Efuse_CalculateWordCnts(u8 word_en);
|
||||||
void EFUSE_GetEfuseDefinition(struct adapter *padapter, u8 efuseType, u8 type, void *pOut, bool bPseudoTest);
|
u8 efuse_OneByteRead(struct adapter *padapter, u16 addr, u8 *data);
|
||||||
u8 efuse_OneByteRead(struct adapter *padapter, u16 addr, u8 *data, bool bPseudoTest);
|
|
||||||
u8 efuse_OneByteWrite(struct adapter *padapter, u16 addr, u8 data, bool bPseudoTest);
|
|
||||||
|
|
||||||
void Efuse_PowerSwitch(struct adapter *padapter, u8 bWrite, u8 PwrState);
|
|
||||||
|
|
||||||
u8 EFUSE_Read1Byte(struct adapter *padapter, u16 Address);
|
u8 EFUSE_Read1Byte(struct adapter *padapter, u16 Address);
|
||||||
void EFUSE_ShadowMapUpdate(struct adapter *padapter, u8 efuseType, bool bPseudoTest);
|
void EFUSE_ShadowMapUpdate(struct adapter *padapter, u8 efuseType);
|
||||||
void EFUSE_ShadowRead(struct adapter *padapter, u8 Type, u16 Offset, u32 *Value);
|
void EFUSE_ShadowRead(struct adapter *padapter, u8 Type, u16 Offset, u32 *Value);
|
||||||
void Rtw_Hal_ReadMACAddrFromFile(struct adapter *padapter);
|
void Rtw_Hal_ReadMACAddrFromFile(struct adapter *padapter);
|
||||||
u32 Rtw_Hal_readPGDataFromConfigFile(struct adapter *padapter);
|
u32 Rtw_Hal_readPGDataFromConfigFile(struct adapter *padapter);
|
||||||
|
|
|
||||||
|
|
@ -395,5 +395,6 @@ u8 rtw_to_roam(struct adapter *adapter);
|
||||||
int rtw_select_roaming_candidate(struct mlme_priv *pmlmepriv);
|
int rtw_select_roaming_candidate(struct mlme_priv *pmlmepriv);
|
||||||
|
|
||||||
void rtw_sta_media_status_rpt(struct adapter *adapter, struct sta_info *psta, u32 mstatus);
|
void rtw_sta_media_status_rpt(struct adapter *adapter, struct sta_info *psta, u32 mstatus);
|
||||||
|
void rtw_reset_securitypriv(struct adapter *adapter);
|
||||||
|
|
||||||
#endif /* __RTL871X_MLME_H_ */
|
#endif /* __RTL871X_MLME_H_ */
|
||||||
|
|
|
||||||
|
|
@ -426,8 +426,6 @@ void init_mlme_default_rate_set(struct adapter *padapter);
|
||||||
void init_mlme_ext_priv(struct adapter *padapter);
|
void init_mlme_ext_priv(struct adapter *padapter);
|
||||||
int init_hw_mlme_ext(struct adapter *padapter);
|
int init_hw_mlme_ext(struct adapter *padapter);
|
||||||
void free_mlme_ext_priv(struct mlme_ext_priv *pmlmeext);
|
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 *padapter, struct sta_info *psta);
|
|
||||||
extern struct xmit_frame *alloc_mgtxmitframe(struct xmit_priv *pxmitpriv);
|
extern struct xmit_frame *alloc_mgtxmitframe(struct xmit_priv *pxmitpriv);
|
||||||
|
|
||||||
/* void fill_fwpriv(struct adapter *padapter, struct fw_priv *pfwpriv); */
|
/* void fill_fwpriv(struct adapter *padapter, struct fw_priv *pfwpriv); */
|
||||||
|
|
|
||||||
|
|
@ -342,6 +342,10 @@ struct recv_buf *rtw_dequeue_recvbuf(struct __queue *queue);
|
||||||
|
|
||||||
void rtw_reordering_ctrl_timeout_handler(struct timer_list *t);
|
void rtw_reordering_ctrl_timeout_handler(struct timer_list *t);
|
||||||
|
|
||||||
|
signed 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(union recv_frame *precv_frame);
|
||||||
|
|
||||||
static inline u8 *get_rxmem(union recv_frame *precvframe)
|
static inline u8 *get_rxmem(union recv_frame *precvframe)
|
||||||
{
|
{
|
||||||
/* always return rx_head... */
|
/* always return rx_head... */
|
||||||
|
|
|
||||||
|
|
@ -1,179 +0,0 @@
|
||||||
// SPDX-License-Identifier: GPL-2.0
|
|
||||||
/******************************************************************************
|
|
||||||
*
|
|
||||||
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
|
|
||||||
*
|
|
||||||
******************************************************************************/
|
|
||||||
#include <drv_types.h>
|
|
||||||
|
|
||||||
static void _dynamic_check_timer_handler(struct timer_list *t)
|
|
||||||
{
|
|
||||||
struct adapter *adapter =
|
|
||||||
timer_container_of(adapter, t, mlmepriv.dynamic_chk_timer);
|
|
||||||
|
|
||||||
rtw_dynamic_check_timer_handler(adapter);
|
|
||||||
|
|
||||||
_set_timer(&adapter->mlmepriv.dynamic_chk_timer, 2000);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void _rtw_set_scan_deny_timer_hdl(struct timer_list *t)
|
|
||||||
{
|
|
||||||
struct adapter *adapter =
|
|
||||||
timer_container_of(adapter, t, mlmepriv.set_scan_deny_timer);
|
|
||||||
|
|
||||||
rtw_clear_scan_deny(adapter);
|
|
||||||
}
|
|
||||||
|
|
||||||
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_handler, 0);
|
|
||||||
timer_setup(&pmlmepriv->set_scan_deny_timer,
|
|
||||||
_rtw_set_scan_deny_timer_hdl, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
void rtw_os_indicate_connect(struct adapter *adapter)
|
|
||||||
{
|
|
||||||
struct mlme_priv *pmlmepriv = &(adapter->mlmepriv);
|
|
||||||
|
|
||||||
if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true) ||
|
|
||||||
(check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true)) {
|
|
||||||
rtw_cfg80211_ibss_indicate_connect(adapter);
|
|
||||||
} else {
|
|
||||||
rtw_cfg80211_indicate_connect(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)
|
|
||||||
{
|
|
||||||
rtw_cfg80211_indicate_scan_done(padapter, aborted);
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct rt_pmkid_list backupPMKIDList[NUM_PMKID_CACHE];
|
|
||||||
void rtw_reset_securitypriv(struct adapter *adapter)
|
|
||||||
{
|
|
||||||
u8 backupPMKIDIndex = 0;
|
|
||||||
u8 backupTKIPCountermeasure = 0x00;
|
|
||||||
u32 backupTKIPcountermeasure_time = 0;
|
|
||||||
/* add for CONFIG_IEEE80211W, none 11w also can use */
|
|
||||||
struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv;
|
|
||||||
|
|
||||||
spin_lock_bh(&adapter->security_key_mutex);
|
|
||||||
|
|
||||||
if (adapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X) {
|
|
||||||
/* 802.1x */
|
|
||||||
/* Added by Albert 2009/02/18 */
|
|
||||||
/* 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(&backupPMKIDList[0], &adapter->securitypriv.PMKIDList[0], sizeof(struct rt_pmkid_list) * NUM_PMKID_CACHE);
|
|
||||||
backupPMKIDIndex = adapter->securitypriv.PMKIDIndex;
|
|
||||||
backupTKIPCountermeasure = adapter->securitypriv.btkip_countermeasure;
|
|
||||||
backupTKIPcountermeasure_time = adapter->securitypriv.btkip_countermeasure_time;
|
|
||||||
|
|
||||||
/* reset RX BIP packet number */
|
|
||||||
pmlmeext->mgnt_80211w_IPN_rx = 0;
|
|
||||||
|
|
||||||
memset((unsigned char *)&adapter->securitypriv, 0, sizeof(struct security_priv));
|
|
||||||
|
|
||||||
/* Added by Albert 2009/02/18 */
|
|
||||||
/* Restore the PMK information to securitypriv structure for the following connection. */
|
|
||||||
memcpy(&adapter->securitypriv.PMKIDList[0], &backupPMKIDList[0], sizeof(struct rt_pmkid_list) * NUM_PMKID_CACHE);
|
|
||||||
adapter->securitypriv.PMKIDIndex = backupPMKIDIndex;
|
|
||||||
adapter->securitypriv.btkip_countermeasure = backupTKIPCountermeasure;
|
|
||||||
adapter->securitypriv.btkip_countermeasure_time = backupTKIPcountermeasure_time;
|
|
||||||
|
|
||||||
adapter->securitypriv.ndisauthtype = Ndis802_11AuthModeOpen;
|
|
||||||
adapter->securitypriv.ndisencryptstatus = Ndis802_11WEPDisabled;
|
|
||||||
|
|
||||||
} else {
|
|
||||||
/* reset values in securitypriv */
|
|
||||||
/* if (adapter->mlmepriv.fw_state & WIFI_STATION_STATE) */
|
|
||||||
/* */
|
|
||||||
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;
|
|
||||||
/* */
|
|
||||||
}
|
|
||||||
/* add for CONFIG_IEEE80211W, none 11w also can use */
|
|
||||||
spin_unlock_bh(&adapter->security_key_mutex);
|
|
||||||
}
|
|
||||||
|
|
||||||
void rtw_os_indicate_disconnect(struct adapter *adapter)
|
|
||||||
{
|
|
||||||
/* struct rt_pmkid_list backupPMKIDList[ NUM_PMKID_CACHE ]; */
|
|
||||||
|
|
||||||
netif_carrier_off(adapter->pnetdev); /* Do it first for tx broadcast pkt after disconnection issue! */
|
|
||||||
|
|
||||||
rtw_cfg80211_indicate_disconnect(adapter);
|
|
||||||
|
|
||||||
/* modify for CONFIG_IEEE80211W, none 11w also can use the same command */
|
|
||||||
rtw_reset_securitypriv_cmd(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 == WLAN_EID_VENDOR_SPECIFIC) {
|
|
||||||
buff = rtw_zmalloc(IW_CUSTOM_MAX);
|
|
||||||
if (!buff)
|
|
||||||
return;
|
|
||||||
|
|
||||||
p = buff;
|
|
||||||
|
|
||||||
p += scnprintf(p, IW_CUSTOM_MAX - (p - buff), "ASSOCINFO(ReqIEs =");
|
|
||||||
|
|
||||||
len = sec_ie[1] + 2;
|
|
||||||
len = (len < IW_CUSTOM_MAX) ? len : IW_CUSTOM_MAX;
|
|
||||||
|
|
||||||
for (i = 0; i < len; i++)
|
|
||||||
p += scnprintf(p, IW_CUSTOM_MAX - (p - buff), "%02x", sec_ie[i]);
|
|
||||||
|
|
||||||
p += scnprintf(p, IW_CUSTOM_MAX - (p - buff), ")");
|
|
||||||
|
|
||||||
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;
|
|
||||||
|
|
||||||
kfree(buff);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
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);
|
|
||||||
timer_setup(&pmlmeext->sa_query_timer, sa_query_timer_hdl, 0);
|
|
||||||
}
|
|
||||||
|
|
@ -1,225 +0,0 @@
|
||||||
// SPDX-License-Identifier: GPL-2.0
|
|
||||||
/******************************************************************************
|
|
||||||
*
|
|
||||||
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
|
|
||||||
*
|
|
||||||
******************************************************************************/
|
|
||||||
#include <drv_types.h>
|
|
||||||
#include <linux/jiffies.h>
|
|
||||||
#include <net/cfg80211.h>
|
|
||||||
#include <linux/unaligned.h>
|
|
||||||
|
|
||||||
void rtw_os_free_recvframe(union recv_frame *precvframe)
|
|
||||||
{
|
|
||||||
if (precvframe->u.hdr.pkt) {
|
|
||||||
dev_kfree_skb_any(precvframe->u.hdr.pkt);/* free skb by driver */
|
|
||||||
|
|
||||||
precvframe->u.hdr.pkt = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* alloc os related resource in union recv_frame */
|
|
||||||
void rtw_os_recv_resource_alloc(struct adapter *padapter, union recv_frame *precvframe)
|
|
||||||
{
|
|
||||||
precvframe->u.hdr.pkt_newalloc = precvframe->u.hdr.pkt = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* free os related resource in union recv_frame */
|
|
||||||
void rtw_os_recv_resource_free(struct recv_priv *precvpriv)
|
|
||||||
{
|
|
||||||
signed int i;
|
|
||||||
union recv_frame *precvframe;
|
|
||||||
|
|
||||||
precvframe = (union recv_frame *) precvpriv->precv_frame_buf;
|
|
||||||
|
|
||||||
for (i = 0; i < NR_RECVFRAME; i++) {
|
|
||||||
if (precvframe->u.hdr.pkt) {
|
|
||||||
/* free skb by driver */
|
|
||||||
dev_kfree_skb_any(precvframe->u.hdr.pkt);
|
|
||||||
precvframe->u.hdr.pkt = NULL;
|
|
||||||
}
|
|
||||||
precvframe++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* free os related resource in struct recv_buf */
|
|
||||||
void rtw_os_recvbuf_resource_free(struct adapter *padapter, struct recv_buf *precvbuf)
|
|
||||||
{
|
|
||||||
if (precvbuf->pskb)
|
|
||||||
dev_kfree_skb_any(precvbuf->pskb);
|
|
||||||
}
|
|
||||||
|
|
||||||
struct sk_buff *rtw_os_alloc_msdu_pkt(union recv_frame *prframe, u16 nSubframe_Length, u8 *pdata)
|
|
||||||
{
|
|
||||||
u16 eth_type;
|
|
||||||
struct sk_buff *sub_skb;
|
|
||||||
struct rx_pkt_attrib *pattrib;
|
|
||||||
|
|
||||||
pattrib = &prframe->u.hdr.attrib;
|
|
||||||
|
|
||||||
sub_skb = rtw_skb_alloc(nSubframe_Length + 12);
|
|
||||||
if (!sub_skb)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
skb_reserve(sub_skb, 12);
|
|
||||||
skb_put_data(sub_skb, (pdata + ETH_HLEN), nSubframe_Length);
|
|
||||||
|
|
||||||
eth_type = get_unaligned_be16(&sub_skb->data[6]);
|
|
||||||
|
|
||||||
if (sub_skb->len >= 8 &&
|
|
||||||
((!memcmp(sub_skb->data, rfc1042_header, SNAP_SIZE) &&
|
|
||||||
eth_type != ETH_P_AARP && eth_type != ETH_P_IPX) ||
|
|
||||||
!memcmp(sub_skb->data, bridge_tunnel_header, SNAP_SIZE))) {
|
|
||||||
/*
|
|
||||||
* remove RFC1042 or Bridge-Tunnel encapsulation and replace
|
|
||||||
* EtherType
|
|
||||||
*/
|
|
||||||
skb_pull(sub_skb, SNAP_SIZE);
|
|
||||||
memcpy(skb_push(sub_skb, ETH_ALEN), pattrib->src, ETH_ALEN);
|
|
||||||
memcpy(skb_push(sub_skb, ETH_ALEN), pattrib->dst, ETH_ALEN);
|
|
||||||
} else {
|
|
||||||
__be16 len;
|
|
||||||
/* Leave Ethernet header part of hdr and full payload */
|
|
||||||
len = htons(sub_skb->len);
|
|
||||||
memcpy(skb_push(sub_skb, 2), &len, 2);
|
|
||||||
memcpy(skb_push(sub_skb, ETH_ALEN), pattrib->src, ETH_ALEN);
|
|
||||||
memcpy(skb_push(sub_skb, ETH_ALEN), pattrib->dst, ETH_ALEN);
|
|
||||||
}
|
|
||||||
|
|
||||||
return sub_skb;
|
|
||||||
}
|
|
||||||
|
|
||||||
void rtw_os_recv_indicate_pkt(struct adapter *padapter, struct sk_buff *pkt, struct rx_pkt_attrib *pattrib)
|
|
||||||
{
|
|
||||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
|
||||||
|
|
||||||
/* Indicate the packets to upper layer */
|
|
||||||
if (pkt) {
|
|
||||||
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) {
|
|
||||||
struct sk_buff *pskb2 = NULL;
|
|
||||||
struct sta_info *psta = NULL;
|
|
||||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
|
||||||
int 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(pkt, GFP_ATOMIC);
|
|
||||||
} else {
|
|
||||||
psta = rtw_get_stainfo(pstapriv, pattrib->dst);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (psta) {
|
|
||||||
struct net_device *pnetdev = (struct net_device *)padapter->pnetdev;
|
|
||||||
/* skb->ip_summed = CHECKSUM_NONE; */
|
|
||||||
pkt->dev = pnetdev;
|
|
||||||
skb_set_queue_mapping(pkt, rtw_recv_select_queue(pkt));
|
|
||||||
|
|
||||||
_rtw_xmit_entry(pkt, pnetdev);
|
|
||||||
|
|
||||||
if (bmcast && pskb2)
|
|
||||||
pkt = pskb2;
|
|
||||||
else
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
/* to APself */
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pkt->protocol = eth_type_trans(pkt, padapter->pnetdev);
|
|
||||||
pkt->dev = padapter->pnetdev;
|
|
||||||
|
|
||||||
pkt->ip_summed = CHECKSUM_NONE;
|
|
||||||
|
|
||||||
rtw_netif_rx(padapter->pnetdev, pkt);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void rtw_handle_tkip_mic_err(struct adapter *padapter, u8 bgroup)
|
|
||||||
{
|
|
||||||
enum nl80211_key_type key_type = 0;
|
|
||||||
union iwreq_data wrqu;
|
|
||||||
struct iw_michaelmicfailure ev;
|
|
||||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
|
||||||
struct security_priv *psecuritypriv = &padapter->securitypriv;
|
|
||||||
unsigned long 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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (bgroup)
|
|
||||||
key_type |= NL80211_KEYTYPE_GROUP;
|
|
||||||
else
|
|
||||||
key_type |= NL80211_KEYTYPE_PAIRWISE;
|
|
||||||
|
|
||||||
cfg80211_michael_mic_failure(padapter->pnetdev, (u8 *)&pmlmepriv->assoc_bssid[0], key_type, -1,
|
|
||||||
NULL, GFP_ATOMIC);
|
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
int rtw_recv_indicatepkt(struct adapter *padapter, union recv_frame *precv_frame)
|
|
||||||
{
|
|
||||||
struct recv_priv *precvpriv;
|
|
||||||
struct __queue *pfree_recv_queue;
|
|
||||||
struct sk_buff *skb;
|
|
||||||
struct rx_pkt_attrib *pattrib = &precv_frame->u.hdr.attrib;
|
|
||||||
|
|
||||||
precvpriv = &(padapter->recvpriv);
|
|
||||||
pfree_recv_queue = &(precvpriv->free_recv_queue);
|
|
||||||
|
|
||||||
skb = precv_frame->u.hdr.pkt;
|
|
||||||
if (!skb)
|
|
||||||
goto _recv_indicatepkt_drop;
|
|
||||||
|
|
||||||
skb->data = precv_frame->u.hdr.rx_data;
|
|
||||||
|
|
||||||
skb_set_tail_pointer(skb, precv_frame->u.hdr.len);
|
|
||||||
|
|
||||||
skb->len = precv_frame->u.hdr.len;
|
|
||||||
|
|
||||||
rtw_os_recv_indicate_pkt(padapter, skb, pattrib);
|
|
||||||
|
|
||||||
/* pointers to NULL before rtw_free_recvframe() */
|
|
||||||
precv_frame->u.hdr.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;
|
|
||||||
}
|
|
||||||
|
|
||||||
void rtw_init_recv_timer(struct recv_reorder_ctrl *preorder_ctrl)
|
|
||||||
{
|
|
||||||
timer_setup(&preorder_ctrl->reordering_ctrl_timer,
|
|
||||||
rtw_reordering_ctrl_timeout_handler, 0);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -50,9 +50,9 @@ struct init_status {
|
||||||
|
|
||||||
struct lynx_accel {
|
struct lynx_accel {
|
||||||
/* base virtual address of DPR registers */
|
/* base virtual address of DPR registers */
|
||||||
volatile unsigned char __iomem *dprBase;
|
unsigned char __iomem *dpr_base;
|
||||||
/* base virtual address of de data port */
|
/* base virtual address of de data port */
|
||||||
volatile unsigned char __iomem *dpPortBase;
|
unsigned char __iomem *dp_port_base;
|
||||||
|
|
||||||
/* function pointers */
|
/* function pointers */
|
||||||
void (*de_init)(struct lynx_accel *accel);
|
void (*de_init)(struct lynx_accel *accel);
|
||||||
|
|
@ -128,7 +128,7 @@ struct lynx_cursor {
|
||||||
char __iomem *vstart;
|
char __iomem *vstart;
|
||||||
int offset;
|
int offset;
|
||||||
/* mmio addr of hw cursor */
|
/* mmio addr of hw cursor */
|
||||||
volatile char __iomem *mmio;
|
char __iomem *mmio;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct lynxfb_crtc {
|
struct lynxfb_crtc {
|
||||||
|
|
|
||||||
|
|
@ -17,19 +17,19 @@
|
||||||
|
|
||||||
#include "sm750.h"
|
#include "sm750.h"
|
||||||
#include "sm750_accel.h"
|
#include "sm750_accel.h"
|
||||||
static inline void write_dpr(struct lynx_accel *accel, int offset, u32 regValue)
|
static inline void write_dpr(struct lynx_accel *accel, int offset, u32 reg_value)
|
||||||
{
|
{
|
||||||
writel(regValue, accel->dprBase + offset);
|
writel(reg_value, accel->dpr_base + offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline u32 read_dpr(struct lynx_accel *accel, int offset)
|
static inline u32 read_dpr(struct lynx_accel *accel, int offset)
|
||||||
{
|
{
|
||||||
return readl(accel->dprBase + offset);
|
return readl(accel->dpr_base + offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void write_dpPort(struct lynx_accel *accel, u32 data)
|
static inline void write_dpPort(struct lynx_accel *accel, u32 data)
|
||||||
{
|
{
|
||||||
writel(data, accel->dpPortBase);
|
writel(data, accel->dp_port_base);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sm750_hw_de_init(struct lynx_accel *accel)
|
void sm750_hw_de_init(struct lynx_accel *accel)
|
||||||
|
|
|
||||||
|
|
@ -58,8 +58,8 @@ int hw_sm750_map(struct sm750_dev *sm750_dev, struct pci_dev *pdev)
|
||||||
}
|
}
|
||||||
pr_info("mmio virtual addr = %p\n", sm750_dev->pvReg);
|
pr_info("mmio virtual addr = %p\n", sm750_dev->pvReg);
|
||||||
|
|
||||||
sm750_dev->accel.dprBase = sm750_dev->pvReg + DE_BASE_ADDR_TYPE1;
|
sm750_dev->accel.dpr_base = sm750_dev->pvReg + DE_BASE_ADDR_TYPE1;
|
||||||
sm750_dev->accel.dpPortBase = sm750_dev->pvReg + DE_PORT_ADDR_TYPE1;
|
sm750_dev->accel.dp_port_base = sm750_dev->pvReg + DE_PORT_ADDR_TYPE1;
|
||||||
|
|
||||||
mmio750 = sm750_dev->pvReg;
|
mmio750 = sm750_dev->pvReg;
|
||||||
sm750_set_chip_type(sm750_dev->devid, sm750_dev->revid);
|
sm750_set_chip_type(sm750_dev->devid, sm750_dev->revid);
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* all the data structures which serialise the MMAL protocol. note
|
* all the data structures which serialise the MMAL protocol. note
|
||||||
* these are directly mapped onto the recived message data.
|
* these are directly mapped onto the received message data.
|
||||||
*
|
*
|
||||||
* BEWARE: They seem to *assume* pointers are u32 and that there is no
|
* BEWARE: They seem to *assume* pointers are u32 and that there is no
|
||||||
* structure padding!
|
* structure padding!
|
||||||
|
|
|
||||||
|
|
@ -326,7 +326,7 @@ static int bulk_receive(struct vchiq_mmal_instance *instance,
|
||||||
* committed a buffer_to_host operation to the mmal
|
* committed a buffer_to_host operation to the mmal
|
||||||
* port without the buffer to back it up (underflow
|
* port without the buffer to back it up (underflow
|
||||||
* handling) and there is no obvious way to deal with
|
* handling) and there is no obvious way to deal with
|
||||||
* this - how is the mmal servie going to react when
|
* this - how is the mmal service going to react when
|
||||||
* we fail to do the xfer and reschedule a buffer when
|
* we fail to do the xfer and reschedule a buffer when
|
||||||
* it arrives? perhaps a starved flag to indicate a
|
* it arrives? perhaps a starved flag to indicate a
|
||||||
* waiting bulk receive?
|
* waiting bulk receive?
|
||||||
|
|
|
||||||
|
|
@ -115,7 +115,7 @@ int vchiq_mmal_component_disable(struct vchiq_mmal_instance *instance,
|
||||||
|
|
||||||
/* enable a mmal port
|
/* enable a mmal port
|
||||||
*
|
*
|
||||||
* enables a port and if a buffer callback provided enque buffer
|
* enables a port and, if a buffer callback provided, enqueues buffer
|
||||||
* headers as appropriate for the port.
|
* headers as appropriate for the port.
|
||||||
*/
|
*/
|
||||||
int vchiq_mmal_port_enable(struct vchiq_mmal_instance *instance,
|
int vchiq_mmal_port_enable(struct vchiq_mmal_instance *instance,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue