Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0ec58c0ad5 | |||
| 42fd0ceab6 | |||
| 4be43770fd | |||
| 3dbabf3092 | |||
| 44b296647b | |||
| 25c0ed8c57 | |||
| 8dd79199f8 | |||
| 979d5436ee |
+16
-8
@@ -1,12 +1,9 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* mac80211 STA and AP API for mac80211 BES2600 drivers
|
||||
* AP mode for BES2600 mac80211 driver
|
||||
*
|
||||
* Copyright (c) 2022, Bestechnic
|
||||
* Author:
|
||||
* Copyright (c) 2022, Bestechnic (Beijing) Co., Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#include "bes2600.h"
|
||||
@@ -65,8 +62,11 @@ int bes2600_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
|
||||
struct bes2600_vif *priv = cw12xx_get_vif_from_ieee80211(vif);
|
||||
struct bes2600_link_entry *entry;
|
||||
struct sk_buff *skb;
|
||||
struct sk_buff_head local_drain;
|
||||
struct bes2600_common *hw_priv = hw->priv;
|
||||
|
||||
__skb_queue_head_init(&local_drain);
|
||||
|
||||
#ifdef P2P_MULTIVIF
|
||||
WARN_ON(priv->if_id == CW12XX_GENERIC_IF_ID);
|
||||
#endif
|
||||
@@ -95,9 +95,17 @@ int bes2600_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
|
||||
IEEE80211_WMM_IE_STA_QOSINFO_AC_MASK)
|
||||
priv->sta_asleep_mask |= BIT(sta_priv->link_id);
|
||||
entry->status = BES2600_LINK_HARD;
|
||||
while ((skb = skb_dequeue(&entry->rx_queue)))
|
||||
ieee80211_rx_irqsafe(priv->hw, skb);
|
||||
/*
|
||||
* Patch C2: splice the rx_queue out under the lock then deliver
|
||||
* after unlock. ieee80211_rx_ni() runs the mac80211 RX path
|
||||
* synchronously (formerly ieee80211_rx_irqsafe deferred to a
|
||||
* tasklet); calling it from inside spin_lock_bh would hold the
|
||||
* lock across mac80211's full RX dispatch.
|
||||
*/
|
||||
skb_queue_splice_init(&entry->rx_queue, &local_drain);
|
||||
spin_unlock_bh(&priv->ps_state_lock);
|
||||
while ((skb = __skb_dequeue(&local_drain)))
|
||||
ieee80211_rx_ni(priv->hw, skb);
|
||||
#ifdef AP_AGGREGATE_FW_FIX
|
||||
hw_priv->connected_sta_cnt++;
|
||||
if(hw_priv->connected_sta_cnt>1) {
|
||||
|
||||
+3
-6
@@ -1,12 +1,9 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* mac80211 STA and AP API for mac80211 BES2600 drivers
|
||||
* AP mode interface for BES2600 mac80211 driver
|
||||
*
|
||||
* Copyright (c) 2010, Bestechnic
|
||||
* Author:
|
||||
* Copyright (c) 2022, Bestechnic (Beijing) Co., Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
#include <linux/version.h>
|
||||
#ifndef AP_H_INCLUDED
|
||||
|
||||
+21
-16
@@ -1,18 +1,15 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* Common private data for BES2600 drivers
|
||||
* Common private data for BES2600 mac80211 driver
|
||||
*
|
||||
* Copyright (c) 2010, Bestechnic
|
||||
* Author:
|
||||
* Copyright (c) 2022, Bestechnic (Beijing) Co., Ltd.
|
||||
*
|
||||
* Based on the mac80211 Prism54 code, which is
|
||||
* Copyright (c) 2006, Michael Wu <flamingice@sourmilk.net>
|
||||
*
|
||||
* Based on the islsm (softmac prism54) driver, which is:
|
||||
* Based on the islsm (softmac prism54) driver, which is
|
||||
* Copyright 2004-2006 Jean-Baptiste Note <jbnote@gmail.com>, et al.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#ifndef BES2600_H
|
||||
@@ -356,15 +353,23 @@ struct bes2600_common {
|
||||
* Keeping in common structure for the time being. Will be moved to VIFF
|
||||
* after the mechanism is clear */
|
||||
u8 ba_tid_mask;
|
||||
int ba_acc; /*TODO: Same as above */
|
||||
int ba_cnt; /*TODO: Same as above */
|
||||
int ba_cnt_rx; /*TODO: Same as above */
|
||||
int ba_acc_rx; /*TODO: Same as above */
|
||||
int ba_hist; /*TODO: Same as above */
|
||||
struct timer_list ba_timer;/*TODO: Same as above */
|
||||
spinlock_t ba_lock; /*TODO: Same as above */
|
||||
bool ba_ena; /*TODO: Same as above */
|
||||
struct work_struct ba_work; /*TODO: Same as above */
|
||||
/*
|
||||
* Patch D: ba_lock removed. Per-frame TX/RX hot-path bumped these
|
||||
* counters under spin_lock_bh; the lock did not protect any
|
||||
* compound invariant that atomic ops can't satisfy. Counters are
|
||||
* now atomic_t; ba_armed gates the once-per-window mod_timer
|
||||
* arm via cmpxchg so concurrent TX/RX at a fresh window each
|
||||
* try to claim the arm and exactly one succeeds.
|
||||
*/
|
||||
atomic_t ba_acc;
|
||||
atomic_t ba_cnt;
|
||||
atomic_t ba_cnt_rx;
|
||||
atomic_t ba_acc_rx;
|
||||
atomic_t ba_armed;
|
||||
int ba_hist;
|
||||
struct timer_list ba_timer;
|
||||
atomic_t ba_ena;
|
||||
struct work_struct ba_work;
|
||||
bool is_BT_Present;
|
||||
bool is_go_thru_go_neg;
|
||||
u8 conf_listen_interval;
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Mac80211 driver for BES2600 device
|
||||
* Factory calibration loader for BES2600
|
||||
*
|
||||
* Copyright (c) 2022, Bestechnic
|
||||
* Author:
|
||||
* Copyright (c) 2022, Bestechnic (Beijing) Co., Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* Mac80211 driver for BES2600 device
|
||||
* Factory calibration loader interface
|
||||
*
|
||||
* Copyright (c) 2022, Bestechnic
|
||||
* Author:
|
||||
* Copyright (c) 2022, Bestechnic (Beijing) Co., Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
#ifndef __FACTORY_H__
|
||||
#define __FACTORY_H__
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* Mac80211 driver for BES2600 device
|
||||
* Platform data for BES2600 SDIO bus
|
||||
*
|
||||
* Copyright (c) 2010, Bestechnic
|
||||
* Author:
|
||||
* Copyright (c) 2022, Bestechnic (Beijing) Co., Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
#ifndef BES2600_PLAT_H_INCLUDED
|
||||
#define BES2600_PLAT_H_INCLUDED
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Mac80211 SDIO driver for BES2600 device
|
||||
* SDIO bus glue for BES2600 mac80211 driver
|
||||
*
|
||||
* Copyright (c) 2022, Bestechnic (Beijing) Co., Ltd.
|
||||
* Derived from drivers/net/wireless/st/cw1200/cw1200_sdio.c
|
||||
* Copyright (c) 2010, ST-Ericsson
|
||||
* Author: Dmitry Tarnyagin <dmitry.tarnyagin@lockless.no>
|
||||
*
|
||||
* Copyright (c) 2010, Bestechnic
|
||||
* Author:
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
#define DEBUG 1
|
||||
#include <linux/version.h>
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Mac80211 driver for BES2600 device
|
||||
* Character device for BES2600 mac80211 driver
|
||||
*
|
||||
* Copyright (c) 2022, Bestechnic
|
||||
* Author:
|
||||
* Copyright (c) 2022, Bestechnic (Beijing) Co., Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
#include<linux/module.h>
|
||||
#include <linux/init.h>
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* Mac80211 driver for BES2600 device
|
||||
* Character device interface for BES2600
|
||||
*
|
||||
* Copyright (c) 2022, Bestechnic
|
||||
* Author:
|
||||
* Copyright (c) 2022, Bestechnic (Beijing) Co., Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
#ifndef __BES_CHARDEV_H__
|
||||
#define __BES_CHARDEV_H__
|
||||
|
||||
+3
-6
@@ -1,12 +1,9 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Mac80211 driver for BES2600 device
|
||||
* Firmware download for BES2600
|
||||
*
|
||||
* Copyright (c) 2022, Bestechnic
|
||||
* Author:
|
||||
* Copyright (c) 2022, Bestechnic (Beijing) Co., Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
#include "bes_fw_common.h"
|
||||
#include "bes2600.h"
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Mac80211 driver for BES2600 device
|
||||
* Firmware download common code for BES2600
|
||||
*
|
||||
* Copyright (c) 2022, Bestechnic
|
||||
* Author:
|
||||
* Copyright (c) 2022, Bestechnic (Beijing) Co., Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
#include "bes_fw_common.h"
|
||||
#include "bes_log.h"
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* Mac80211 driver for BES2600 device
|
||||
* Firmware download common interface
|
||||
*
|
||||
* Copyright (c) 2022, Bestechnic
|
||||
* Author:
|
||||
* Copyright (c) 2022, Bestechnic (Beijing) Co., Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
#ifndef __BES_FW_COMMON_H__
|
||||
#define __BES_FW_COMMON_H__
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* printk wrappers for BES2600
|
||||
*
|
||||
* Copyright (c) 2022, Bestechnic (Beijing) Co., Ltd.
|
||||
*
|
||||
*/
|
||||
extern struct device *global_dev;
|
||||
|
||||
#ifdef CONFIG_BES2600_ENABLE_DEVEL_LOGS
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* Mac80211 driver for BES2600 device
|
||||
* Vendor testmode messages for BES2600
|
||||
*
|
||||
* Copyright (c) 2010, Bestechnic
|
||||
* Author:
|
||||
* Copyright (c) 2022, Bestechnic (Beijing) Co., Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#ifndef BES_NL80211_TESTMODE_MSG_H
|
||||
|
||||
+3
-6
@@ -1,12 +1,9 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Mac80211 driver for BES2600 device
|
||||
* Chip-side power state machine for BES2600
|
||||
*
|
||||
* Copyright (c) 2022, Bestechnic
|
||||
* Author:
|
||||
* Copyright (c) 2022, Bestechnic (Beijing) Co., Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
#include <linux/list.h>
|
||||
#include <linux/pm.h>
|
||||
|
||||
+3
-6
@@ -1,12 +1,9 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* Mac80211 driver for BES2600 device
|
||||
* Chip-side power state machine interface
|
||||
*
|
||||
* Copyright (c) 2022, Bestechnic
|
||||
* Author:
|
||||
* Copyright (c) 2022, Bestechnic (Beijing) Co., Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
#ifndef __BES_PWR_H__
|
||||
#define __BES_PWR_H__
|
||||
|
||||
+6
-6
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Mac80211 driver for BES2600 device
|
||||
* Bottom-half thread for BES2600 mac80211 driver
|
||||
*
|
||||
* Copyright (c) 2022, Bestechnic
|
||||
* Author:
|
||||
* Copyright (c) 2010, ST-Ericsson
|
||||
* Author: Dmitry Tarnyagin <dmitry.tarnyagin@lockless.no>
|
||||
*
|
||||
* Copyright (c) 2022, Bestechnic (Beijing) Co., Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
#include <net/mac80211.h>
|
||||
#include <linux/kthread.h>
|
||||
|
||||
+6
-6
@@ -1,12 +1,12 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* Device handling thread interface for mac80211 BES2600 drivers
|
||||
* Bottom-half thread interface for BES2600 mac80211 driver
|
||||
*
|
||||
* Copyright (c) 2010, Bestechnic
|
||||
* Author:
|
||||
* Copyright (c) 2010, ST-Ericsson
|
||||
* Author: Dmitry Tarnyagin <dmitry.tarnyagin@lockless.no>
|
||||
*
|
||||
* Copyright (c) 2022, Bestechnic (Beijing) Co., Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#ifndef BES2600_BH_H
|
||||
|
||||
+14
-11
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Mac80211 driver for BES2600 device
|
||||
* Debugging interface for BES2600 mac80211 driver
|
||||
*
|
||||
* Copyright (c) 2022, Bestechnic
|
||||
* Author:
|
||||
* Copyright (c) 2010, ST-Ericsson
|
||||
* Author: Dmitry Tarnyagin <dmitry.tarnyagin@lockless.no>
|
||||
*
|
||||
* Copyright (c) 2022, Bestechnic (Beijing) Co., Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
@@ -110,17 +110,20 @@ static int bes2600_status_show_common(struct seq_file *seq, void *v)
|
||||
int ba_cnt, ba_acc, ba_cnt_rx, ba_acc_rx, ba_avg = 0, ba_avg_rx = 0;
|
||||
bool ba_ena;
|
||||
|
||||
spin_lock_bh(&hw_priv->ba_lock);
|
||||
ba_cnt = hw_priv->debug->ba_cnt;
|
||||
ba_acc = hw_priv->debug->ba_acc;
|
||||
/*
|
||||
* Patch D: ba_lock removed. hw_priv->debug->ba_* are written only
|
||||
* by the timer callback (single writer); reading without a lock is
|
||||
* fine for stats. ba_ena is atomic_t.
|
||||
*/
|
||||
ba_cnt = hw_priv->debug->ba_cnt;
|
||||
ba_acc = hw_priv->debug->ba_acc;
|
||||
ba_cnt_rx = hw_priv->debug->ba_cnt_rx;
|
||||
ba_acc_rx = hw_priv->debug->ba_acc_rx;
|
||||
ba_ena = hw_priv->ba_ena;
|
||||
ba_ena = !!atomic_read(&hw_priv->ba_ena);
|
||||
if (ba_cnt)
|
||||
ba_avg = ba_acc / ba_cnt;
|
||||
if (ba_cnt_rx)
|
||||
ba_avg_rx = ba_acc_rx / ba_cnt_rx;
|
||||
spin_unlock_bh(&hw_priv->ba_lock);
|
||||
|
||||
seq_puts(seq, "BES2600 Wireless LAN driver status\n");
|
||||
seq_printf(seq, "Hardware: %d.%d\n",
|
||||
|
||||
+6
-6
@@ -1,12 +1,12 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* DebugFS code for BES2600 mac80211 driver
|
||||
* Debugging interface for BES2600 mac80211 driver
|
||||
*
|
||||
* Copyright (c) 2011, Bestechnic
|
||||
* Author:
|
||||
* Copyright (c) 2010, ST-Ericsson
|
||||
* Author: Dmitry Tarnyagin <dmitry.tarnyagin@lockless.no>
|
||||
*
|
||||
* Copyright (c) 2022, Bestechnic (Beijing) Co., Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#ifndef BES2600_DEBUG_H_INCLUDED
|
||||
|
||||
+3
-6
@@ -1,12 +1,9 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Mac80211 driver for BES2600 device
|
||||
* BT/WiFi coexistence (ePTA) for BES2600
|
||||
*
|
||||
* Copyright (c) 2022, Bestechnic
|
||||
* Author:
|
||||
* Copyright (c) 2022, Bestechnic (Beijing) Co., Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
#include <linux/types.h>
|
||||
#include <linux/version.h>
|
||||
|
||||
+3
-6
@@ -1,12 +1,9 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* Mac80211 driver for BES2600 device
|
||||
* BT/WiFi coexistence interface for BES2600
|
||||
*
|
||||
* Copyright (c) 2022, Bestechnic
|
||||
* Author:
|
||||
* Copyright (c) 2022, Bestechnic (Beijing) Co., Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
#ifndef __EPTA_COEX_H__
|
||||
#define __EPTA_COEX_H__
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Mac80211 driver for BES2600 device
|
||||
* BT/WiFi coexistence request handling
|
||||
*
|
||||
* Copyright (c) 2022, Bestechnic
|
||||
* Author:
|
||||
* Copyright (c) 2022, Bestechnic (Beijing) Co., Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
#include <linux/types.h>
|
||||
#include <linux/kernel.h>
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* Mac80211 driver for BES2600 device
|
||||
* BT/WiFi coexistence request interface
|
||||
*
|
||||
* Copyright (c) 2022, Bestechnic
|
||||
* Author:
|
||||
* Copyright (c) 2022, Bestechnic (Beijing) Co., Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
#ifndef EPTA_REQUEST_H
|
||||
#define EPTA_REQUEST_H
|
||||
|
||||
+6
-6
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Mac80211 driver for BES2600 device
|
||||
* Firmware I/O for BES2600 mac80211 driver
|
||||
*
|
||||
* Copyright (c) 2022, Bestechnic
|
||||
* Author:
|
||||
* Copyright (c) 2010, ST-Ericsson
|
||||
* Author: Dmitry Tarnyagin <dmitry.tarnyagin@lockless.no>
|
||||
*
|
||||
* Copyright (c) 2022, Bestechnic (Beijing) Co., Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#include <linux/init.h>
|
||||
|
||||
+6
-6
@@ -1,12 +1,12 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* Mac80211 driver for BES2600 device
|
||||
* Firmware I/O interface for BES2600 mac80211 driver
|
||||
*
|
||||
* Copyright (c) 2022, Bestechnic
|
||||
* Author:
|
||||
* Copyright (c) 2010, ST-Ericsson
|
||||
* Author: Dmitry Tarnyagin <dmitry.tarnyagin@lockless.no>
|
||||
*
|
||||
* Copyright (c) 2022, Bestechnic (Beijing) Co., Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
#ifndef FWIO_H_INCLUDED
|
||||
#define FWIO_H_INCLUDED
|
||||
|
||||
+3
-6
@@ -1,12 +1,9 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* HT-related code for BES2600 driver
|
||||
* HT capability config for BES2600
|
||||
*
|
||||
* Copyright (c) 2010, Bestechnic
|
||||
* Author:
|
||||
* Copyright (c) 2022, Bestechnic (Beijing) Co., Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#ifndef BES2600_HT_H_INCLUDED
|
||||
|
||||
+6
-6
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Low-level device IO routines for BES2600 drivers
|
||||
* Low-level device I/O for BES2600 mac80211 driver
|
||||
*
|
||||
* Copyright (c) 2022, Bestechnic
|
||||
* Author:
|
||||
* Copyright (c) 2010, ST-Ericsson
|
||||
* Author: Dmitry Tarnyagin <dmitry.tarnyagin@lockless.no>
|
||||
*
|
||||
* Copyright (c) 2022, Bestechnic (Beijing) Co., Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
+5
-10
@@ -1,17 +1,12 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* Low-level API for mac80211 BES2600 drivers
|
||||
* Low-level device I/O interface for BES2600 mac80211 driver
|
||||
*
|
||||
* Copyright (c) 2010, Bestechnic
|
||||
* Author:
|
||||
* Copyright (c) 2010, ST-Ericsson
|
||||
* Author: Dmitry Tarnyagin <dmitry.tarnyagin@lockless.no>
|
||||
*
|
||||
* Based on:
|
||||
* UMAC BES2600 driver which is
|
||||
* Copyright (c) 2010, Bestechnic
|
||||
* Author:
|
||||
* Copyright (c) 2022, Bestechnic (Beijing) Co., Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#ifndef BES2600_HWIO_H_INCLUDED
|
||||
|
||||
+3
-7
@@ -1,13 +1,9 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* mac80211 glue code for mac80211 BES2600 drivers
|
||||
* ITP code
|
||||
* ITP (in-band test mode) for BES2600
|
||||
*
|
||||
* Copyright (c) 2010, Bestechnic
|
||||
* Author:
|
||||
* Copyright (c) 2022, Bestechnic (Beijing) Co., Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
|
||||
+3
-6
@@ -1,12 +1,9 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* ITP code for BES2600 mac80211 driver
|
||||
* ITP interface for BES2600
|
||||
*
|
||||
* Copyright (c) 2011, Bestechnic
|
||||
* Author:
|
||||
* Copyright (c) 2022, Bestechnic (Beijing) Co., Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#ifndef BES2600_ITP_H_INCLUDED
|
||||
|
||||
+13
-7
@@ -1,12 +1,18 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Mac80211 driver for BES2600 device
|
||||
* Main entry/init for BES2600 mac80211 driver
|
||||
*
|
||||
* Copyright (c) 2022, Bestechnic
|
||||
* Author:
|
||||
* Copyright (c) 2010, ST-Ericsson
|
||||
* Author: Dmitry Tarnyagin <dmitry.tarnyagin@lockless.no>
|
||||
*
|
||||
* Copyright (c) 2022, Bestechnic (Beijing) Co., Ltd.
|
||||
*
|
||||
* Based on the mac80211 Prism54 code, which is
|
||||
* Copyright (c) 2006, Michael Wu <flamingice@sourmilk.net>
|
||||
*
|
||||
* Based on the islsm (softmac prism54) driver, which is
|
||||
* Copyright 2004-2006 Jean-Baptiste Note <jbnote@gmail.com>, et al.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
@@ -490,7 +496,7 @@ static struct ieee80211_hw *bes2600_init_common(size_t hw_priv_data_len)
|
||||
INIT_LIST_HEAD(&hw_priv->event_queue);
|
||||
INIT_WORK(&hw_priv->event_handler, bes2600_event_handler);
|
||||
INIT_WORK(&hw_priv->ba_work, bes2600_ba_work);
|
||||
spin_lock_init(&hw_priv->ba_lock);
|
||||
/* Patch D: ba_lock removed; ba_acc/ba_cnt/etc are atomic_t. */
|
||||
timer_setup(&hw_priv->ba_timer, bes2600_ba_timer, 0);
|
||||
|
||||
if (unlikely(bes2600_queue_stats_init(&hw_priv->tx_queue_stats,
|
||||
|
||||
+6
-6
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Mac80211 power management API for BES2600 drivers
|
||||
* Power management for BES2600 mac80211 driver
|
||||
*
|
||||
* Copyright (c) 2011, Bestechnic
|
||||
* Author:
|
||||
* Copyright (c) 2010, ST-Ericsson
|
||||
* Author: Dmitry Tarnyagin <dmitry.tarnyagin@lockless.no>
|
||||
*
|
||||
* Copyright (c) 2022, Bestechnic (Beijing) Co., Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#include <linux/platform_device.h>
|
||||
|
||||
+6
-6
@@ -1,12 +1,12 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* Mac80211 power management interface for BES2600 mac80211 drivers
|
||||
* Power management interface for BES2600 mac80211 driver
|
||||
*
|
||||
* Copyright (c) 2011, Bestechnic
|
||||
* Author:
|
||||
* Copyright (c) 2010, ST-Ericsson
|
||||
* Author: Dmitry Tarnyagin <dmitry.tarnyagin@lockless.no>
|
||||
*
|
||||
* Copyright (c) 2022, Bestechnic (Beijing) Co., Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#ifndef PM_H_INCLUDED
|
||||
|
||||
+6
-6
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* O(1) TX queue with built-in allocator for BES2600 drivers
|
||||
* O(1) TX queue for BES2600 mac80211 driver
|
||||
*
|
||||
* Copyright (c) 2022, Bestechnic
|
||||
* Author:
|
||||
* Copyright (c) 2010, ST-Ericsson
|
||||
* Author: Dmitry Tarnyagin <dmitry.tarnyagin@lockless.no>
|
||||
*
|
||||
* Copyright (c) 2022, Bestechnic (Beijing) Co., Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#include <net/mac80211.h>
|
||||
|
||||
+6
-6
@@ -1,12 +1,12 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* O(1) TX queue with built-in allocator for BES2600 drivers
|
||||
* O(1) TX queue interface for BES2600 mac80211 driver
|
||||
*
|
||||
* Copyright (c) 2010, Bestechnic
|
||||
* Author:
|
||||
* Copyright (c) 2010, ST-Ericsson
|
||||
* Author: Dmitry Tarnyagin <dmitry.tarnyagin@lockless.no>
|
||||
*
|
||||
* Copyright (c) 2022, Bestechnic (Beijing) Co., Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#ifndef BES2600_QUEUE_H_INCLUDED
|
||||
|
||||
+6
-6
@@ -1,12 +1,12 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* Common sbus abstraction layer interface for bes2600 wireless driver
|
||||
* Bus abstraction interface for BES2600
|
||||
*
|
||||
* Copyright (c) 2022, Bestechnic (Beijing) Co., Ltd.
|
||||
* Replaces hwbus.h from drivers/net/wireless/st/cw1200/
|
||||
* Copyright (c) 2010, ST-Ericsson
|
||||
*
|
||||
* Copyright (c) 2010, Bestechnic
|
||||
* Author:
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#ifndef BES2600_SBUS_H
|
||||
|
||||
+6
-6
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Scan implementation for BES2600 mac80211 drivers
|
||||
* Scan implementation for BES2600 mac80211 driver
|
||||
*
|
||||
* Copyright (c) 2022, Bestechnic
|
||||
* Author:
|
||||
* Copyright (c) 2010, ST-Ericsson
|
||||
* Author: Dmitry Tarnyagin <dmitry.tarnyagin@lockless.no>
|
||||
*
|
||||
* Copyright (c) 2022, Bestechnic (Beijing) Co., Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#include <linux/sched.h>
|
||||
|
||||
+6
-6
@@ -1,12 +1,12 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* Scan interface for BES2600 mac80211 drivers
|
||||
* Scan interface for BES2600 mac80211 driver
|
||||
*
|
||||
* Copyright (c) 2010, Bestechnic
|
||||
* Author:
|
||||
* Copyright (c) 2010, ST-Ericsson
|
||||
* Author: Dmitry Tarnyagin <dmitry.tarnyagin@lockless.no>
|
||||
*
|
||||
* Copyright (c) 2022, Bestechnic (Beijing) Co., Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#ifndef SCAN_H_INCLUDED
|
||||
|
||||
+53
-38
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Mac80211 STA API for BES2600 drivers
|
||||
* Mac80211 STA API for BES2600 mac80211 driver
|
||||
*
|
||||
* Copyright (c) 2022, Bestechnic
|
||||
* Author:
|
||||
* Copyright (c) 2010, ST-Ericsson
|
||||
* Author: Dmitry Tarnyagin <dmitry.tarnyagin@lockless.no>
|
||||
*
|
||||
* Copyright (c) 2022, Bestechnic (Beijing) Co., Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#include <linux/vmalloc.h>
|
||||
@@ -1484,7 +1484,7 @@ void bes2600_event_handler(struct work_struct *work)
|
||||
IEEE80211_STYPE_DEAUTH | IEEE80211_FCTL_TODS);
|
||||
deauth->u.deauth.reason_code = WLAN_REASON_DEAUTH_LEAVING;
|
||||
deauth->seq_ctrl = 0;
|
||||
ieee80211_rx_irqsafe(priv->hw, skb);
|
||||
ieee80211_rx_ni(priv->hw, skb);
|
||||
bes_devel(" Inactivity Deauth Frame sent for MAC SA %pM \t and DA %pM\n", deauth->sa, deauth->da);
|
||||
queue_work(priv->hw_priv->workqueue, &priv->set_tim_work);
|
||||
break;
|
||||
@@ -2342,14 +2342,19 @@ void bes2600_join_work(struct work_struct *work)
|
||||
//WARN_ON(wsm_reset(hw_priv, &reset, priv->if_id));
|
||||
WARN_ON(wsm_set_block_ack_policy(hw_priv,
|
||||
0, hw_priv->ba_tid_mask, priv->if_id));
|
||||
spin_lock_bh(&hw_priv->ba_lock);
|
||||
hw_priv->ba_ena = false;
|
||||
hw_priv->ba_cnt = 0;
|
||||
hw_priv->ba_acc = 0;
|
||||
/*
|
||||
* Patch D: ba_lock removed. Disconnect-reset clears the
|
||||
* counters and the arm flag; producers racing here cannot
|
||||
* cause harm — at worst they re-arm the timer and bump
|
||||
* counters that will be cleared on the next timer tick.
|
||||
*/
|
||||
atomic_set(&hw_priv->ba_ena, 0);
|
||||
atomic_set(&hw_priv->ba_cnt, 0);
|
||||
atomic_set(&hw_priv->ba_acc, 0);
|
||||
hw_priv->ba_hist = 0;
|
||||
hw_priv->ba_cnt_rx = 0;
|
||||
hw_priv->ba_acc_rx = 0;
|
||||
spin_unlock_bh(&hw_priv->ba_lock);
|
||||
atomic_set(&hw_priv->ba_cnt_rx, 0);
|
||||
atomic_set(&hw_priv->ba_acc_rx, 0);
|
||||
atomic_set(&hw_priv->ba_armed, 0);
|
||||
|
||||
mgmt_policy.protectedMgmtEnable = 0;
|
||||
mgmt_policy.unprotectedMgmtFramesAllowed = 1;
|
||||
@@ -2629,10 +2634,11 @@ void bes2600_ba_work(struct work_struct *work)
|
||||
return;*/
|
||||
|
||||
bes_devel("BA work****\n");
|
||||
spin_lock_bh(&hw_priv->ba_lock);
|
||||
// tx_ba_tid_mask = hw_priv->ba_ena ? hw_priv->ba_tid_mask : 0;
|
||||
/*
|
||||
* Patch D: ba_lock removed. ba_tid_mask is u8 set once at init
|
||||
* (main.c); reading it without a lock is fine.
|
||||
*/
|
||||
tx_ba_tid_mask = hw_priv->ba_tid_mask;
|
||||
spin_unlock_bh(&hw_priv->ba_lock);
|
||||
|
||||
wsm_lock_tx(hw_priv);
|
||||
|
||||
@@ -2645,37 +2651,49 @@ void bes2600_ba_work(struct work_struct *work)
|
||||
void bes2600_ba_timer(struct timer_list *t)
|
||||
{
|
||||
bool ba_ena;
|
||||
int cnt, acc, cnt_rx, acc_rx;
|
||||
struct bes2600_common *hw_priv = from_timer(hw_priv, t, ba_timer);
|
||||
|
||||
spin_lock_bh(&hw_priv->ba_lock);
|
||||
bes2600_debug_ba(hw_priv, hw_priv->ba_cnt, hw_priv->ba_acc,
|
||||
hw_priv->ba_cnt_rx, hw_priv->ba_acc_rx);
|
||||
/*
|
||||
* Patch D: ba_lock removed. Snapshot atomic counters into locals
|
||||
* for the predicate evaluation; producers may race incrementing
|
||||
* after the snapshot but the resulting decision is approximate
|
||||
* which the policy already tolerates (next timer tick re-evaluates).
|
||||
*/
|
||||
cnt = atomic_read(&hw_priv->ba_cnt);
|
||||
acc = atomic_read(&hw_priv->ba_acc);
|
||||
cnt_rx = atomic_read(&hw_priv->ba_cnt_rx);
|
||||
acc_rx = atomic_read(&hw_priv->ba_acc_rx);
|
||||
|
||||
bes2600_debug_ba(hw_priv, cnt, acc, cnt_rx, acc_rx);
|
||||
|
||||
if (atomic_read(&hw_priv->scan.in_progress)) {
|
||||
hw_priv->ba_cnt = 0;
|
||||
hw_priv->ba_acc = 0;
|
||||
hw_priv->ba_cnt_rx = 0;
|
||||
hw_priv->ba_acc_rx = 0;
|
||||
goto skip_statistic_update;
|
||||
atomic_set(&hw_priv->ba_cnt, 0);
|
||||
atomic_set(&hw_priv->ba_acc, 0);
|
||||
atomic_set(&hw_priv->ba_cnt_rx, 0);
|
||||
atomic_set(&hw_priv->ba_acc_rx, 0);
|
||||
atomic_set(&hw_priv->ba_armed, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
if (hw_priv->ba_cnt >= BES2600_BLOCK_ACK_CNT &&
|
||||
(hw_priv->ba_acc / hw_priv->ba_cnt >= BES2600_BLOCK_ACK_THLD ||
|
||||
(hw_priv->ba_cnt_rx >= BES2600_BLOCK_ACK_CNT &&
|
||||
hw_priv->ba_acc_rx / hw_priv->ba_cnt_rx >=
|
||||
if (cnt >= BES2600_BLOCK_ACK_CNT &&
|
||||
(acc / cnt >= BES2600_BLOCK_ACK_THLD ||
|
||||
(cnt_rx >= BES2600_BLOCK_ACK_CNT &&
|
||||
acc_rx / cnt_rx >=
|
||||
BES2600_BLOCK_ACK_THLD)))
|
||||
ba_ena = true;
|
||||
else
|
||||
ba_ena = false;
|
||||
|
||||
hw_priv->ba_cnt = 0;
|
||||
hw_priv->ba_acc = 0;
|
||||
hw_priv->ba_cnt_rx = 0;
|
||||
hw_priv->ba_acc_rx = 0;
|
||||
atomic_set(&hw_priv->ba_cnt, 0);
|
||||
atomic_set(&hw_priv->ba_acc, 0);
|
||||
atomic_set(&hw_priv->ba_cnt_rx, 0);
|
||||
atomic_set(&hw_priv->ba_acc_rx, 0);
|
||||
atomic_set(&hw_priv->ba_armed, 0);
|
||||
|
||||
if (ba_ena != hw_priv->ba_ena) {
|
||||
if (ba_ena != !!atomic_read(&hw_priv->ba_ena)) {
|
||||
if (ba_ena || ++hw_priv->ba_hist >= BES2600_BLOCK_ACK_HIST) {
|
||||
hw_priv->ba_ena = ba_ena;
|
||||
atomic_set(&hw_priv->ba_ena, ba_ena ? 1 : 0);
|
||||
hw_priv->ba_hist = 0;
|
||||
#if 0
|
||||
bes_devel("[STA] %s block ACK:\n",
|
||||
@@ -2685,9 +2703,6 @@ void bes2600_ba_timer(struct timer_list *t)
|
||||
}
|
||||
} else if (hw_priv->ba_hist)
|
||||
--hw_priv->ba_hist;
|
||||
|
||||
skip_statistic_update:
|
||||
spin_unlock_bh(&hw_priv->ba_lock);
|
||||
}
|
||||
|
||||
int bes2600_vif_setup(struct bes2600_vif *priv)
|
||||
|
||||
+6
-6
@@ -1,12 +1,12 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* Mac80211 STA interface for BES2600 mac80211 drivers
|
||||
* Mac80211 STA API interface for BES2600 mac80211 driver
|
||||
*
|
||||
* Copyright (c) 2010, Bestechnic
|
||||
* Author:
|
||||
* Copyright (c) 2010, ST-Ericsson
|
||||
* Author: Dmitry Tarnyagin <dmitry.tarnyagin@lockless.no>
|
||||
*
|
||||
* Copyright (c) 2022, Bestechnic (Beijing) Co., Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
#include <linux/version.h>
|
||||
#ifndef STA_H_INCLUDED
|
||||
|
||||
+3
-6
@@ -1,12 +1,9 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Mac80211 driver for BES2600 device
|
||||
* Test-mode TX loopback for BES2600
|
||||
*
|
||||
* Copyright (c) 2022, Bestechnic
|
||||
* Author:
|
||||
* Copyright (c) 2022, Bestechnic (Beijing) Co., Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
#include "bes2600.h"
|
||||
#include "wsm.h"
|
||||
|
||||
+3
-6
@@ -1,12 +1,9 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* Mac80211 driver for BES2600 device
|
||||
* Test-mode TX loopback interface for BES2600
|
||||
*
|
||||
* Copyright (c) 2022, Bestechnic
|
||||
* Author:
|
||||
* Copyright (c) 2022, Bestechnic (Beijing) Co., Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
#ifndef __TX_LOOP_H__
|
||||
#define __TX_LOOP_H__
|
||||
|
||||
+45
-24
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Datapath implementation for BES2600 mac80211 drivers
|
||||
* Datapath implementation for BES2600 mac80211 driver
|
||||
*
|
||||
* Copyright (c) 2022, Bestechnic
|
||||
* Author:
|
||||
* Copyright (c) 2010, ST-Ericsson
|
||||
* Author: Dmitry Tarnyagin <dmitry.tarnyagin@lockless.no>
|
||||
*
|
||||
* Copyright (c) 2022, Bestechnic (Beijing) Co., Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#include <net/mac80211.h>
|
||||
@@ -995,14 +995,18 @@ bes2600_tx_h_ba_stat(struct bes2600_vif *priv,
|
||||
if (!ieee80211_is_data(t->hdr->frame_control))
|
||||
return;
|
||||
|
||||
spin_lock_bh(&hw_priv->ba_lock);
|
||||
hw_priv->ba_acc += t->skb->len - t->hdrlen;
|
||||
if (!(hw_priv->ba_cnt_rx || hw_priv->ba_cnt)) {
|
||||
/*
|
||||
* Patch D: lock-free hot-path BA accounting. atomic_inc + atomic_add
|
||||
* each per-frame; the once-per-window timer-arm uses cmpxchg on
|
||||
* ba_armed so concurrent TX/RX can't both try to set the timer and
|
||||
* we don't need cross-counter coherency on the ba_cnt/ba_cnt_rx pair.
|
||||
*/
|
||||
atomic_add(t->skb->len - t->hdrlen, &hw_priv->ba_acc);
|
||||
atomic_inc(&hw_priv->ba_cnt);
|
||||
if (atomic_cmpxchg(&hw_priv->ba_armed, 0, 1) == 0) {
|
||||
mod_timer(&hw_priv->ba_timer,
|
||||
jiffies + BES2600_BLOCK_ACK_INTERVAL);
|
||||
}
|
||||
hw_priv->ba_cnt++;
|
||||
spin_unlock_bh(&hw_priv->ba_lock);
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -1629,14 +1633,13 @@ bes2600_rx_h_ba_stat(struct bes2600_vif *priv,
|
||||
if (!priv->setbssparams_done)
|
||||
return;
|
||||
|
||||
spin_lock_bh(&hw_priv->ba_lock);
|
||||
hw_priv->ba_acc_rx += skb_len - hdrlen;
|
||||
if (!(hw_priv->ba_cnt_rx || hw_priv->ba_cnt)) {
|
||||
/* Patch D: lock-free hot-path BA accounting; see TX side comment. */
|
||||
atomic_add(skb_len - hdrlen, &hw_priv->ba_acc_rx);
|
||||
atomic_inc(&hw_priv->ba_cnt_rx);
|
||||
if (atomic_cmpxchg(&hw_priv->ba_armed, 0, 1) == 0) {
|
||||
mod_timer(&hw_priv->ba_timer,
|
||||
jiffies + BES2600_BLOCK_ACK_INTERVAL);
|
||||
}
|
||||
hw_priv->ba_cnt_rx++;
|
||||
spin_unlock_bh(&hw_priv->ba_lock);
|
||||
}
|
||||
|
||||
void bes2600_rx_cb(struct bes2600_vif *priv,
|
||||
@@ -1939,15 +1942,33 @@ void bes2600_rx_cb(struct bes2600_vif *priv,
|
||||
if (unlikely(bes2600_itp_rxed(hw_priv, skb)))
|
||||
consume_skb(skb);
|
||||
else if (unlikely(early_data)) {
|
||||
spin_lock_bh(&priv->ps_state_lock);
|
||||
/* Double-check status with lock held */
|
||||
if (entry->status == BES2600_LINK_SOFT)
|
||||
skb_queue_tail(&entry->rx_queue, skb);
|
||||
else
|
||||
ieee80211_rx_irqsafe(priv->hw, skb);
|
||||
spin_unlock_bh(&priv->ps_state_lock);
|
||||
/*
|
||||
* Patch E: when c7 has latched pm_unsupported (firmware
|
||||
* doesn't honour PSM, see feedback_bes2600_firmware_no_psm),
|
||||
* AP-side power-save state machine is dead and link entries
|
||||
* never transition to BES2600_LINK_SOFT. The double-check
|
||||
* branch under ps_state_lock is unreachable in that case,
|
||||
* so skip the per-frame lock acquisition entirely and
|
||||
* deliver to mac80211 directly.
|
||||
*
|
||||
* On firmware that does honour PSM (the latch self-clears
|
||||
* if a real PM_INDICATION ever arrives — see c7), this
|
||||
* predicate flips back to false and the original locked
|
||||
* path is taken.
|
||||
*/
|
||||
if (hw_priv->bes_power.pm_unsupported) {
|
||||
ieee80211_rx_ni(priv->hw, skb);
|
||||
} else {
|
||||
spin_lock_bh(&priv->ps_state_lock);
|
||||
/* Double-check status with lock held */
|
||||
if (entry->status == BES2600_LINK_SOFT)
|
||||
skb_queue_tail(&entry->rx_queue, skb);
|
||||
else
|
||||
ieee80211_rx_ni(priv->hw, skb);
|
||||
spin_unlock_bh(&priv->ps_state_lock);
|
||||
}
|
||||
} else {
|
||||
ieee80211_rx_irqsafe(priv->hw, skb);
|
||||
ieee80211_rx_ni(priv->hw, skb);
|
||||
}
|
||||
*skb_p = NULL;
|
||||
|
||||
|
||||
+6
-6
@@ -1,12 +1,12 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* Datapath interface for BES2600 mac80211 drivers
|
||||
* Datapath interface for BES2600 mac80211 driver
|
||||
*
|
||||
* Copyright (c) 2010, Bestechnic
|
||||
* Author:
|
||||
* Copyright (c) 2010, ST-Ericsson
|
||||
* Author: Dmitry Tarnyagin <dmitry.tarnyagin@lockless.no>
|
||||
*
|
||||
* Copyright (c) 2022, Bestechnic (Beijing) Co., Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#ifndef BES2600_TXRX_H
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Mac80211 driver for BES2600 device
|
||||
* WiFi testmode commands for BES2600
|
||||
*
|
||||
* Copyright (c) 2022, Bestechnic
|
||||
* Author:
|
||||
* Copyright (c) 2022, Bestechnic (Beijing) Co., Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
#ifdef CONFIG_BES2600_TESTMODE
|
||||
#include <net/netlink.h>
|
||||
|
||||
+7
-8
@@ -1,13 +1,12 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* WSM host interface (HI) implementation for
|
||||
* BES2600 mac80211 drivers.
|
||||
* WSM host interface for BES2600 mac80211 driver
|
||||
*
|
||||
* Copyright (c) 2022, Bestechnic
|
||||
* Author:
|
||||
* Copyright (c) 2010, ST-Ericsson
|
||||
* Author: Dmitry Tarnyagin <dmitry.tarnyagin@lockless.no>
|
||||
*
|
||||
* Copyright (c) 2022, Bestechnic (Beijing) Co., Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#include <linux/skbuff.h>
|
||||
@@ -2413,7 +2412,7 @@ int wsm_handle_rx(struct bes2600_common *hw_priv, int id,
|
||||
if (!hw_priv->beacon_bkp)
|
||||
hw_priv->beacon_bkp = \
|
||||
skb_copy(hw_priv->beacon, GFP_ATOMIC);
|
||||
ieee80211_rx_irqsafe(hw_priv->hw, hw_priv->beacon);
|
||||
ieee80211_rx_ni(hw_priv->hw, hw_priv->beacon);
|
||||
hw_priv->beacon = hw_priv->beacon_bkp;
|
||||
|
||||
hw_priv->beacon_bkp = NULL;
|
||||
|
||||
+5
-9
@@ -1,16 +1,12 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* WSM host interface (HI) interface for BES2600 mac80211 drivers
|
||||
* WSM host interface for BES2600 mac80211 driver
|
||||
*
|
||||
* Copyright (c) 2022, Bestechnic
|
||||
* Author:
|
||||
* Copyright (c) 2010, ST-Ericsson
|
||||
* Author: Dmitry Tarnyagin <dmitry.tarnyagin@lockless.no>
|
||||
*
|
||||
* Based on BES2600 UMAC WSM API, which is
|
||||
* Copyright (C) SA 2010
|
||||
* Author: Stewart Mathers <stewart.mathers@stericsson.com>
|
||||
* Copyright (c) 2022, Bestechnic (Beijing) Co., Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#ifndef BES2600_WSM_H_INCLUDED
|
||||
|
||||
Reference in New Issue
Block a user