mirror of
https://github.com/shenmintao/aic8800d80.git
synced 2026-09-26 17:44:16 +00:00
Sync WiFi driver, firmware, and DKMS configuration from the bluetooth
branch (which itself is radxa USB driver_fw + Linux 6.16/6.17/6.19
kernel compat). aic_btusb and Bluetooth-specific install.sh logic
are intentionally excluded from main.
Driver updates:
- Add Linux kernel 6.12-6.19 compatibility support
- Add Linux 6.16 timer_container_of and wakelock API support
- Add Debian 6.1.0-26 backport support
- Add USB device ID 368b:8d81 support
- Add AIC8800DW device support
- Add TP-Link Archer TX1U Nano support (USB_VENDOR_ID_TENDA_V2:0x0110)
- Add TENDA series device support (U2, U11, U11 PRO)
- Add AIC8800FC_CUS1-6 series support
- Add AIC8800M80_CUS0-8 series support
- Add UGREEN AIC8800D80 adapter support
- Add Mercury (TP-Link OEM) support
- Allow 1 or 3 USB interfaces (BT-disabled SKUs report 1)
New compat modules:
- aicwf_compat_8800d80n.{c,h}
- aicwf_compat_8800dln.{c,h}
Firmware:
- New: fw/aic8800/, fw/aic8800D80N/, fw/aic8800D80X2/, fw/aic8800DLN/
- Updated: fw/aic8800D80/, fw/aic8800DC/
install.sh:
- Loop over all fw/aic8800* variants instead of hard-coding aic8800D80
- Install usb_modeswitch/1111_1111 config for "Pandora" clone adapter
- Verify firmware install by counting variants
dkms.conf: pass KDIR explicitly to make for cross-kernel builds.
Excluded from this commit (BT-only, kept on bluetooth branch):
- drivers/aic8800/aic_btusb/
- modprobe/aic8800-bt.conf
- diagnose_bt.sh
- install.sh btusb auto-load / hciconfig / bluez status checks
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
119 lines
2.9 KiB
C
119 lines
2.9 KiB
C
#ifndef _AICWF_TCP_ACK_H_
|
|
#define _AICWF_TCP_ACK_H_
|
|
|
|
#include <uapi/linux/if_ether.h>
|
|
#include <uapi/linux/tcp.h>
|
|
#include <uapi/linux/ip.h>
|
|
#include <uapi/linux/in.h>
|
|
#include <linux/moduleparam.h>
|
|
#include <net/tcp.h>
|
|
#include <linux/timer.h>
|
|
#include <linux/version.h>
|
|
|
|
|
|
#define TCP_ACK_NUM 32
|
|
#define TCP_ACK_EXIT_VAL 0x800
|
|
#define TCP_ACK_DROP_CNT 10
|
|
|
|
#define ACK_OLD_TIME 4000
|
|
#define U32_BEFORE(a, b) ((__s32)((__u32)a - (__u32)b) <= 0)
|
|
|
|
#define MAX_TCP_ACK 200
|
|
/*min window size in KB, it's 256KB*/
|
|
#define MIN_WIN 256
|
|
#define SIZE_KB 1024
|
|
|
|
|
|
struct msg_buf {
|
|
//struct list_head list;
|
|
struct sk_buff *skb;
|
|
struct rwnx_vif *rwnx_vif;
|
|
/* data just tx cmd use,not include the head */
|
|
};
|
|
|
|
struct tcp_ack_msg {
|
|
u16 source;
|
|
u16 dest;
|
|
s32 saddr;
|
|
s32 daddr;
|
|
u32 seq;
|
|
u16 win;
|
|
};
|
|
|
|
|
|
struct tcp_ack_info {
|
|
int ack_info_num;
|
|
int busy;
|
|
int drop_cnt;
|
|
int psh_flag;
|
|
u32 psh_seq;
|
|
u16 win_scale;
|
|
/* seqlock for ack info */
|
|
seqlock_t seqlock;
|
|
unsigned long last_time;
|
|
unsigned long timeout;
|
|
struct timer_list timer;
|
|
struct msg_buf *msgbuf;
|
|
struct msg_buf *in_send_msg;
|
|
struct tcp_ack_msg ack_msg;
|
|
};
|
|
|
|
struct tcp_ack_manage {
|
|
/* 1 filter */
|
|
atomic_t enable;
|
|
int max_num;
|
|
int free_index;
|
|
unsigned long last_time;
|
|
unsigned long timeout;
|
|
atomic_t max_drop_cnt;
|
|
/* lock for tcp ack alloc and free */
|
|
spinlock_t lock;
|
|
struct rwnx_hw *priv;
|
|
struct tcp_ack_info ack_info[TCP_ACK_NUM];
|
|
/*size in KB*/
|
|
unsigned int ack_winsize;
|
|
};
|
|
|
|
struct msg_buf *intf_tcp_alloc_msg(struct msg_buf *msg);
|
|
|
|
void tcp_ack_init(struct rwnx_hw *priv);
|
|
|
|
void tcp_ack_deinit(struct rwnx_hw *priv);
|
|
|
|
|
|
int is_drop_tcp_ack(struct tcphdr *tcphdr, int tcp_tot_len, unsigned short *win_scale);
|
|
|
|
int is_tcp_ack(struct sk_buff *skb, unsigned short *win_scale);
|
|
|
|
int filter_send_tcp_ack(struct rwnx_hw *priv, struct msg_buf *msgbuf,unsigned char *buf, unsigned int plen);
|
|
|
|
void filter_rx_tcp_ack(struct rwnx_hw *priv,unsigned char *buf, unsigned plen);
|
|
|
|
void move_tcpack_msg(struct rwnx_hw *priv, struct msg_buf * msg);
|
|
void intf_tcp_drop_msg(struct rwnx_hw *priv, struct msg_buf *msg);
|
|
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0)
|
|
void tcp_ack_timeout(unsigned long data);
|
|
#else
|
|
void tcp_ack_timeout(struct timer_list *t);
|
|
#endif
|
|
int tcp_check_quick_ack(unsigned char *buf, struct tcp_ack_msg *msg);
|
|
int tcp_check_ack(unsigned char *buf,
|
|
struct tcp_ack_msg *msg,
|
|
unsigned short *win_scale);
|
|
int tcp_ack_match(struct tcp_ack_manage *ack_m, struct tcp_ack_msg *ack_msg);
|
|
void tcp_ack_update(struct tcp_ack_manage *ack_m);
|
|
int tcp_ack_alloc_index(struct tcp_ack_manage *ack_m);
|
|
int tcp_ack_handle(struct msg_buf *new_msgbuf,
|
|
struct tcp_ack_manage *ack_m,
|
|
struct tcp_ack_info *ack_info,
|
|
struct tcp_ack_msg *ack_msg,
|
|
int type);
|
|
int tcp_ack_handle_new(struct msg_buf *new_msgbuf,
|
|
struct tcp_ack_manage *ack_m,
|
|
struct tcp_ack_info *ack_info,
|
|
struct tcp_ack_msg *ack_msg,
|
|
int type);
|
|
|
|
|
|
#endif
|