hc
2024-02-20 e636c8d336489bf3eed5878299e6cc045bbad077
kernel/drivers/staging/rtl8192u/r8192U.h
....@@ -1,3 +1,4 @@
1
+/* SPDX-License-Identifier: GPL-2.0 */
12 /*
23 * This is part of rtl8187 OpenSource driver.
34 * Copyright (C) Andrea Merello 2004-2005 <andrea.merello@gmail.com>
....@@ -39,19 +40,19 @@
3940 #include "ieee80211/ieee80211.h"
4041
4142 #define RTL8192U
42
-#define RTL819xU_MODULE_NAME "rtl819xU"
43
+#define RTL819XU_MODULE_NAME "rtl819xU"
4344 /* HW security */
4445 #define MAX_KEY_LEN 61
4546 #define KEY_BUF_SIZE 5
4647
47
-#define Rx_Smooth_Factor 20
48
+#define RX_SMOOTH_FACTOR 20
4849 #define DMESG(x, a...)
4950 #define DMESGW(x, a...)
5051 #define DMESGE(x, a...)
5152 extern u32 rt_global_debug_component;
5253 #define RT_TRACE(component, x, args...) \
5354 do { \
54
- if (rt_global_debug_component & component) \
55
+ if (rt_global_debug_component & (component)) \
5556 pr_debug("RTL8192U: " x "\n", ##args); \
5657 } while (0)
5758
....@@ -111,7 +112,7 @@
111112 do { \
112113 if ((rt_global_debug_component & (level)) == (level)) { \
113114 int i; \
114
- u8 *pdata = (u8 *) data; \
115
+ u8 *pdata = (u8 *)data; \
115116 pr_debug("RTL8192U: %s()\n", __func__); \
116117 for (i = 0; i < (int)(datalen); i++) { \
117118 printk("%2x ", pdata[i]); \
....@@ -363,13 +364,13 @@
363364 FW_STATUS_5_READY = 5,
364365 } firmware_status_e;
365366
366
-typedef struct _rt_firmare_seg_container {
367
+typedef struct _fw_seg_container {
367368 u16 seg_size;
368369 u8 *seg_ptr;
369370 } fw_seg_container, *pfw_seg_container;
370371 typedef struct _rt_firmware {
371372 firmware_status_e firmware_status;
372
- u16 cmdpacket_frag_thresold;
373
+ u16 cmdpacket_frag_threshold;
373374 #define RTL8190_MAX_FIRMWARE_CODE_SIZE 64000
374375 u8 firmware_buf[RTL8190_MAX_FIRMWARE_CODE_SIZE];
375376 u16 firmware_buf_size;
....@@ -798,6 +799,18 @@
798799 TXCMD_XXXX_CTRL,
799800 } DCMD_TXCMD_OP;
800801
802
+enum version_819xu {
803
+ VERSION_819XU_A, // A-cut
804
+ VERSION_819XU_B, // B-cut
805
+ VERSION_819XU_C,// C-cut
806
+};
807
+
808
+//added for different RF type
809
+enum rt_rf_type {
810
+ RF_1T2R = 0,
811
+ RF_2T4R,
812
+};
813
+
801814 typedef struct r8192_priv {
802815 struct usb_device *udev;
803816 /* For maintain info from eeprom */
....@@ -815,7 +828,7 @@
815828 /* O: rtl8192, 1: rtl8185 V B/C, 2: rtl8185 V D */
816829 short card_8192;
817830 /* If TCR reports card V B/C, this discriminates */
818
- u8 card_8192_version;
831
+ enum version_819xu card_8192_version;
819832 short enable_gpio0;
820833 enum card_type {
821834 PCI, MINIPCI, CARDBUS, USB
....@@ -838,7 +851,7 @@
838851
839852 struct mutex wx_mutex;
840853
841
- u8 rf_type; /* 0: 1T2R, 1: 2T4R */
854
+ enum rt_rf_type rf_type; /* 0: 1T2R, 1: 2T4R */
842855 RT_RF_TYPE_819xU rf_chip;
843856
844857 short (*rf_set_sens)(struct net_device *dev, short sens);
....@@ -864,9 +877,9 @@
864877 int rx_inx;
865878 #endif
866879
867
- struct sk_buff_head rx_queue;
868
- struct sk_buff_head skb_queue;
869
- struct work_struct qos_activate;
880
+ struct sk_buff_head rx_queue;
881
+ struct sk_buff_head skb_queue;
882
+ struct work_struct qos_activate;
870883 short tx_urb_index;
871884 atomic_t tx_pending[0x10]; /* UART_PRIORITY + 1 */
872885
....@@ -1000,7 +1013,7 @@
10001013 bool bis_any_nonbepkts;
10011014 bool bcurrent_turbo_EDCA;
10021015 bool bis_cur_rdlstate;
1003
- struct timer_list fsync_timer;
1016
+ struct delayed_work fsync_work;
10041017 bool bfsync_processing; /* 500ms Fsync timer is active or not */
10051018 u32 rate_record;
10061019 u32 rateCountDiffRecord;
....@@ -1014,7 +1027,7 @@
10141027 u8 nrxAMPDU_aggr_num;
10151028
10161029 /* For gpio */
1017
- bool bHwRadioOff;
1030
+ bool bHwRadioOff;
10181031
10191032 u32 reset_count;
10201033 bool bpbc_pressed;
....@@ -1079,9 +1092,6 @@
10791092 short rtl819xU_tx_cmd(struct net_device *dev, struct sk_buff *skb);
10801093 short rtl8192_tx(struct net_device *dev, struct sk_buff *skb);
10811094
1082
-u32 read_cam(struct net_device *dev, u8 addr);
1083
-void write_cam(struct net_device *dev, u8 addr, u32 data);
1084
-
10851095 int read_nic_byte(struct net_device *dev, int x, u8 *data);
10861096 int read_nic_byte_E(struct net_device *dev, int x, u8 *data);
10871097 int read_nic_dword(struct net_device *dev, int x, u32 *data);
....@@ -1094,22 +1104,12 @@
10941104
10951105 void rtl8192_rtx_disable(struct net_device *dev);
10961106 void rtl8192_rx_enable(struct net_device *dev);
1097
-void rtl8192_tx_enable(struct net_device *dev);
10981107
1099
-void rtl8192_disassociate(struct net_device *dev);
1100
-void rtl8185_set_rf_pins_enable(struct net_device *dev, u32 a);
1101
-
1102
-void rtl8192_set_anaparam(struct net_device *dev, u32 a);
1103
-void rtl8185_set_anaparam2(struct net_device *dev, u32 a);
11041108 void rtl8192_update_msr(struct net_device *dev);
11051109 int rtl8192_down(struct net_device *dev);
11061110 int rtl8192_up(struct net_device *dev);
11071111 void rtl8192_commit(struct net_device *dev);
11081112 void rtl8192_set_chan(struct net_device *dev, short ch);
1109
-void write_phy(struct net_device *dev, u8 adr, u8 data);
1110
-void write_phy_cck(struct net_device *dev, u8 adr, u32 data);
1111
-void write_phy_ofdm(struct net_device *dev, u8 adr, u32 data);
1112
-void rtl8185_tx_antenna(struct net_device *dev, u8 ant);
11131113 void rtl8192_set_rxconf(struct net_device *dev);
11141114 void rtl819xusb_beacon_tx(struct net_device *dev, u16 tx_rate);
11151115