diff options
author | Lorenzo Bianconi <lorenzo.bianconi@redhat.com> | 2018-10-04 17:53:08 -0400 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2018-10-05 14:05:45 -0400 |
commit | e40803f2afa81d35aaa712217eda821e8806b32b (patch) | |
tree | d38a49d41ff16de6aa1e265755aae7a6c1e40d4a /drivers/net/wireless | |
parent | 46a7418761e59ea5fa98c8234924ec02dfc3a2b3 (diff) |
mt76x2: move mt76x2_dev in mt76x02_util.h
Move mt76x2_dev in mt76x02_util.h and rename it in mt76x02_dev
in order to be shared between mt76x2 and mt76x0 driver
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless')
33 files changed, 537 insertions, 509 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_dfs.h b/drivers/net/wireless/mediatek/mt76/mt76x02_dfs.h new file mode 100644 index 000000000000..7e177c934592 --- /dev/null +++ b/drivers/net/wireless/mediatek/mt76/mt76x02_dfs.h | |||
@@ -0,0 +1,140 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2016 Lorenzo Bianconi <lorenzo.bianconi83@gmail.com> | ||
3 | * | ||
4 | * Permission to use, copy, modify, and/or distribute this software for any | ||
5 | * purpose with or without fee is hereby granted, provided that the above | ||
6 | * copyright notice and this permission notice appear in all copies. | ||
7 | * | ||
8 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
9 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
10 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
11 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
12 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
13 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
14 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
15 | */ | ||
16 | |||
17 | #ifndef __MT76x02_DFS_H | ||
18 | #define __MT76x02_DFS_H | ||
19 | |||
20 | #include <linux/types.h> | ||
21 | #include <linux/nl80211.h> | ||
22 | |||
23 | #define MT_DFS_GP_INTERVAL (10 << 4) /* 64 us unit */ | ||
24 | #define MT_DFS_NUM_ENGINES 4 | ||
25 | |||
26 | /* bbp params */ | ||
27 | #define MT_DFS_SYM_ROUND 0 | ||
28 | #define MT_DFS_DELTA_DELAY 2 | ||
29 | #define MT_DFS_VGA_MASK 0 | ||
30 | #define MT_DFS_PWR_GAIN_OFFSET 3 | ||
31 | #define MT_DFS_PWR_DOWN_TIME 0xf | ||
32 | #define MT_DFS_RX_PE_MASK 0xff | ||
33 | #define MT_DFS_PKT_END_MASK 0 | ||
34 | #define MT_DFS_CH_EN 0xf | ||
35 | |||
36 | /* sw detector params */ | ||
37 | #define MT_DFS_EVENT_LOOP 64 | ||
38 | #define MT_DFS_SW_TIMEOUT (HZ / 20) | ||
39 | #define MT_DFS_EVENT_WINDOW (HZ / 5) | ||
40 | #define MT_DFS_SEQUENCE_WINDOW (200 * (1 << 20)) | ||
41 | #define MT_DFS_EVENT_TIME_MARGIN 2000 | ||
42 | #define MT_DFS_PRI_MARGIN 4 | ||
43 | #define MT_DFS_SEQUENCE_TH 6 | ||
44 | |||
45 | #define MT_DFS_FCC_MAX_PRI ((28570 << 1) + 1000) | ||
46 | #define MT_DFS_FCC_MIN_PRI (3000 - 2) | ||
47 | #define MT_DFS_JP_MAX_PRI ((80000 << 1) + 1000) | ||
48 | #define MT_DFS_JP_MIN_PRI (28500 - 2) | ||
49 | #define MT_DFS_ETSI_MAX_PRI (133333 + 125000 + 117647 + 1000) | ||
50 | #define MT_DFS_ETSI_MIN_PRI (4500 - 20) | ||
51 | |||
52 | struct mt76x02_radar_specs { | ||
53 | u8 mode; | ||
54 | u16 avg_len; | ||
55 | u16 e_low; | ||
56 | u16 e_high; | ||
57 | u16 w_low; | ||
58 | u16 w_high; | ||
59 | u16 w_margin; | ||
60 | u32 t_low; | ||
61 | u32 t_high; | ||
62 | u16 t_margin; | ||
63 | u32 b_low; | ||
64 | u32 b_high; | ||
65 | u32 event_expiration; | ||
66 | u16 pwr_jmp; | ||
67 | }; | ||
68 | |||
69 | #define MT_DFS_CHECK_EVENT(x) ((x) != GENMASK(31, 0)) | ||
70 | #define MT_DFS_EVENT_ENGINE(x) (((x) & BIT(31)) ? 2 : 0) | ||
71 | #define MT_DFS_EVENT_TIMESTAMP(x) ((x) & GENMASK(21, 0)) | ||
72 | #define MT_DFS_EVENT_WIDTH(x) ((x) & GENMASK(11, 0)) | ||
73 | struct mt76x02_dfs_event { | ||
74 | unsigned long fetch_ts; | ||
75 | u32 ts; | ||
76 | u16 width; | ||
77 | u8 engine; | ||
78 | }; | ||
79 | |||
80 | #define MT_DFS_EVENT_BUFLEN 256 | ||
81 | struct mt76x02_dfs_event_rb { | ||
82 | struct mt76x02_dfs_event data[MT_DFS_EVENT_BUFLEN]; | ||
83 | int h_rb, t_rb; | ||
84 | }; | ||
85 | |||
86 | struct mt76x02_dfs_sequence { | ||
87 | struct list_head head; | ||
88 | u32 first_ts; | ||
89 | u32 last_ts; | ||
90 | u32 pri; | ||
91 | u16 count; | ||
92 | u8 engine; | ||
93 | }; | ||
94 | |||
95 | struct mt76x02_dfs_hw_pulse { | ||
96 | u8 engine; | ||
97 | u32 period; | ||
98 | u32 w1; | ||
99 | u32 w2; | ||
100 | u32 burst; | ||
101 | }; | ||
102 | |||
103 | struct mt76x02_dfs_sw_detector_params { | ||
104 | u32 min_pri; | ||
105 | u32 max_pri; | ||
106 | u32 pri_margin; | ||
107 | }; | ||
108 | |||
109 | struct mt76x02_dfs_engine_stats { | ||
110 | u32 hw_pattern; | ||
111 | u32 hw_pulse_discarded; | ||
112 | u32 sw_pattern; | ||
113 | }; | ||
114 | |||
115 | struct mt76x02_dfs_seq_stats { | ||
116 | u32 seq_pool_len; | ||
117 | u32 seq_len; | ||
118 | }; | ||
119 | |||
120 | struct mt76x02_dfs_pattern_detector { | ||
121 | enum nl80211_dfs_regions region; | ||
122 | |||
123 | u8 chirp_pulse_cnt; | ||
124 | u32 chirp_pulse_ts; | ||
125 | |||
126 | struct mt76x02_dfs_sw_detector_params sw_dpd_params; | ||
127 | struct mt76x02_dfs_event_rb event_rb[2]; | ||
128 | |||
129 | struct list_head sequences; | ||
130 | struct list_head seq_pool; | ||
131 | struct mt76x02_dfs_seq_stats seq_stats; | ||
132 | |||
133 | unsigned long last_sw_check; | ||
134 | u32 last_event_ts; | ||
135 | |||
136 | struct mt76x02_dfs_engine_stats stats[MT_DFS_NUM_ENGINES]; | ||
137 | struct tasklet_struct dfs_tasklet; | ||
138 | }; | ||
139 | |||
140 | #endif /* __MT76x02_DFS_H */ | ||
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_util.h b/drivers/net/wireless/mediatek/mt76/mt76x02_util.h index f78526fcf423..9b473e39392c 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x02_util.h +++ b/drivers/net/wireless/mediatek/mt76/mt76x02_util.h | |||
@@ -18,7 +18,76 @@ | |||
18 | #ifndef __MT76X02_UTIL_H | 18 | #ifndef __MT76X02_UTIL_H |
19 | #define __MT76X02_UTIL_H | 19 | #define __MT76X02_UTIL_H |
20 | 20 | ||
21 | #include <linux/kfifo.h> | ||
22 | |||
21 | #include "mt76x02_mac.h" | 23 | #include "mt76x02_mac.h" |
24 | #include "mt76x02_dfs.h" | ||
25 | |||
26 | #define MT_MAX_CHAINS 2 | ||
27 | struct mt76x02_rx_freq_cal { | ||
28 | s8 high_gain[MT_MAX_CHAINS]; | ||
29 | s8 rssi_offset[MT_MAX_CHAINS]; | ||
30 | s8 lna_gain; | ||
31 | u32 mcu_gain; | ||
32 | }; | ||
33 | |||
34 | struct mt76x02_calibration { | ||
35 | struct mt76x02_rx_freq_cal rx; | ||
36 | |||
37 | u8 agc_gain_init[MT_MAX_CHAINS]; | ||
38 | u8 agc_gain_cur[MT_MAX_CHAINS]; | ||
39 | |||
40 | u16 false_cca; | ||
41 | s8 avg_rssi_all; | ||
42 | s8 agc_gain_adjust; | ||
43 | s8 low_gain; | ||
44 | |||
45 | u8 temp; | ||
46 | |||
47 | bool init_cal_done; | ||
48 | bool tssi_cal_done; | ||
49 | bool tssi_comp_pending; | ||
50 | bool dpd_cal_done; | ||
51 | bool channel_cal_done; | ||
52 | }; | ||
53 | |||
54 | struct mt76x02_dev { | ||
55 | struct mt76_dev mt76; /* must be first */ | ||
56 | |||
57 | struct mac_address macaddr_list[8]; | ||
58 | |||
59 | struct mutex mutex; | ||
60 | |||
61 | u8 txdone_seq; | ||
62 | DECLARE_KFIFO_PTR(txstatus_fifo, struct mt76x02_tx_status); | ||
63 | |||
64 | struct sk_buff *rx_head; | ||
65 | |||
66 | struct tasklet_struct tx_tasklet; | ||
67 | struct tasklet_struct pre_tbtt_tasklet; | ||
68 | struct delayed_work cal_work; | ||
69 | struct delayed_work mac_work; | ||
70 | |||
71 | u32 aggr_stats[32]; | ||
72 | |||
73 | struct sk_buff *beacons[8]; | ||
74 | u8 beacon_mask; | ||
75 | u8 beacon_data_mask; | ||
76 | |||
77 | u8 tbtt_count; | ||
78 | u16 beacon_int; | ||
79 | |||
80 | struct mt76x02_calibration cal; | ||
81 | |||
82 | s8 target_power; | ||
83 | s8 target_power_delta[2]; | ||
84 | bool enable_tpc; | ||
85 | |||
86 | u8 coverage_class; | ||
87 | u8 slottime; | ||
88 | |||
89 | struct mt76x02_dfs_pattern_detector dfs_pd; | ||
90 | }; | ||
22 | 91 | ||
23 | extern struct ieee80211_rate mt76x02_rates[12]; | 92 | extern struct ieee80211_rate mt76x02_rates[12]; |
24 | 93 | ||
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/common.c b/drivers/net/wireless/mediatek/mt76/mt76x2/common.c index fa6bad3bf613..eb9861f89e1a 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2/common.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x2/common.c | |||
@@ -21,7 +21,7 @@ | |||
21 | void mt76x2_queue_rx_skb(struct mt76_dev *mdev, enum mt76_rxq_id q, | 21 | void mt76x2_queue_rx_skb(struct mt76_dev *mdev, enum mt76_rxq_id q, |
22 | struct sk_buff *skb) | 22 | struct sk_buff *skb) |
23 | { | 23 | { |
24 | struct mt76x2_dev *dev = container_of(mdev, struct mt76x2_dev, mt76); | 24 | struct mt76x02_dev *dev = container_of(mdev, struct mt76x02_dev, mt76); |
25 | void *rxwi = skb->data; | 25 | void *rxwi = skb->data; |
26 | 26 | ||
27 | if (q == MT_RXQ_MCU) { | 27 | if (q == MT_RXQ_MCU) { |
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/debugfs.c b/drivers/net/wireless/mediatek/mt76/mt76x2/debugfs.c index ea373bae1522..e8f8ccc0a5ed 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2/debugfs.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x2/debugfs.c | |||
@@ -20,7 +20,7 @@ | |||
20 | static int | 20 | static int |
21 | mt76x2_ampdu_stat_read(struct seq_file *file, void *data) | 21 | mt76x2_ampdu_stat_read(struct seq_file *file, void *data) |
22 | { | 22 | { |
23 | struct mt76x2_dev *dev = file->private; | 23 | struct mt76x02_dev *dev = file->private; |
24 | int i, j; | 24 | int i, j; |
25 | 25 | ||
26 | for (i = 0; i < 4; i++) { | 26 | for (i = 0; i < 4; i++) { |
@@ -49,7 +49,7 @@ mt76x2_ampdu_stat_open(struct inode *inode, struct file *f) | |||
49 | 49 | ||
50 | static int read_txpower(struct seq_file *file, void *data) | 50 | static int read_txpower(struct seq_file *file, void *data) |
51 | { | 51 | { |
52 | struct mt76x2_dev *dev = dev_get_drvdata(file->private); | 52 | struct mt76x02_dev *dev = dev_get_drvdata(file->private); |
53 | 53 | ||
54 | seq_printf(file, "Target power: %d\n", dev->target_power); | 54 | seq_printf(file, "Target power: %d\n", dev->target_power); |
55 | 55 | ||
@@ -68,9 +68,9 @@ static const struct file_operations fops_ampdu_stat = { | |||
68 | static int | 68 | static int |
69 | mt76x2_dfs_stat_read(struct seq_file *file, void *data) | 69 | mt76x2_dfs_stat_read(struct seq_file *file, void *data) |
70 | { | 70 | { |
71 | struct mt76x02_dev *dev = file->private; | ||
72 | struct mt76x02_dfs_pattern_detector *dfs_pd = &dev->dfs_pd; | ||
71 | int i; | 73 | int i; |
72 | struct mt76x2_dev *dev = file->private; | ||
73 | struct mt76x2_dfs_pattern_detector *dfs_pd = &dev->dfs_pd; | ||
74 | 74 | ||
75 | seq_printf(file, "allocated sequences:\t%d\n", | 75 | seq_printf(file, "allocated sequences:\t%d\n", |
76 | dfs_pd->seq_stats.seq_pool_len); | 76 | dfs_pd->seq_stats.seq_pool_len); |
@@ -106,7 +106,7 @@ static const struct file_operations fops_dfs_stat = { | |||
106 | 106 | ||
107 | static int read_agc(struct seq_file *file, void *data) | 107 | static int read_agc(struct seq_file *file, void *data) |
108 | { | 108 | { |
109 | struct mt76x2_dev *dev = dev_get_drvdata(file->private); | 109 | struct mt76x02_dev *dev = dev_get_drvdata(file->private); |
110 | 110 | ||
111 | seq_printf(file, "avg_rssi: %d\n", dev->cal.avg_rssi_all); | 111 | seq_printf(file, "avg_rssi: %d\n", dev->cal.avg_rssi_all); |
112 | seq_printf(file, "low_gain: %d\n", dev->cal.low_gain); | 112 | seq_printf(file, "low_gain: %d\n", dev->cal.low_gain); |
@@ -116,7 +116,7 @@ static int read_agc(struct seq_file *file, void *data) | |||
116 | return 0; | 116 | return 0; |
117 | } | 117 | } |
118 | 118 | ||
119 | void mt76x2_init_debugfs(struct mt76x2_dev *dev) | 119 | void mt76x2_init_debugfs(struct mt76x02_dev *dev) |
120 | { | 120 | { |
121 | struct dentry *dir; | 121 | struct dentry *dir; |
122 | 122 | ||
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/dfs.h b/drivers/net/wireless/mediatek/mt76/mt76x2/dfs.h index 693f421bf096..3cb9d1864286 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2/dfs.h +++ b/drivers/net/wireless/mediatek/mt76/mt76x2/dfs.h | |||
@@ -14,133 +14,13 @@ | |||
14 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 14 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | #ifndef __MT76x2_DFS_H | 17 | #ifndef __DFS_H |
18 | #define __MT76x2_DFS_H | 18 | #define __DFS_H |
19 | 19 | ||
20 | #include <linux/types.h> | 20 | void mt76x2_dfs_init_params(struct mt76x02_dev *dev); |
21 | #include <linux/nl80211.h> | 21 | void mt76x2_dfs_init_detector(struct mt76x02_dev *dev); |
22 | 22 | void mt76x2_dfs_adjust_agc(struct mt76x02_dev *dev); | |
23 | #define MT_DFS_GP_INTERVAL (10 << 4) /* 64 us unit */ | 23 | void mt76x2_dfs_set_domain(struct mt76x02_dev *dev, |
24 | #define MT_DFS_NUM_ENGINES 4 | ||
25 | |||
26 | /* bbp params */ | ||
27 | #define MT_DFS_SYM_ROUND 0 | ||
28 | #define MT_DFS_DELTA_DELAY 2 | ||
29 | #define MT_DFS_VGA_MASK 0 | ||
30 | #define MT_DFS_PWR_GAIN_OFFSET 3 | ||
31 | #define MT_DFS_PWR_DOWN_TIME 0xf | ||
32 | #define MT_DFS_RX_PE_MASK 0xff | ||
33 | #define MT_DFS_PKT_END_MASK 0 | ||
34 | #define MT_DFS_CH_EN 0xf | ||
35 | |||
36 | /* sw detector params */ | ||
37 | #define MT_DFS_EVENT_LOOP 64 | ||
38 | #define MT_DFS_SW_TIMEOUT (HZ / 20) | ||
39 | #define MT_DFS_EVENT_WINDOW (HZ / 5) | ||
40 | #define MT_DFS_SEQUENCE_WINDOW (200 * (1 << 20)) | ||
41 | #define MT_DFS_EVENT_TIME_MARGIN 2000 | ||
42 | #define MT_DFS_PRI_MARGIN 4 | ||
43 | #define MT_DFS_SEQUENCE_TH 6 | ||
44 | |||
45 | #define MT_DFS_FCC_MAX_PRI ((28570 << 1) + 1000) | ||
46 | #define MT_DFS_FCC_MIN_PRI (3000 - 2) | ||
47 | #define MT_DFS_JP_MAX_PRI ((80000 << 1) + 1000) | ||
48 | #define MT_DFS_JP_MIN_PRI (28500 - 2) | ||
49 | #define MT_DFS_ETSI_MAX_PRI (133333 + 125000 + 117647 + 1000) | ||
50 | #define MT_DFS_ETSI_MIN_PRI (4500 - 20) | ||
51 | |||
52 | struct mt76x2_radar_specs { | ||
53 | u8 mode; | ||
54 | u16 avg_len; | ||
55 | u16 e_low; | ||
56 | u16 e_high; | ||
57 | u16 w_low; | ||
58 | u16 w_high; | ||
59 | u16 w_margin; | ||
60 | u32 t_low; | ||
61 | u32 t_high; | ||
62 | u16 t_margin; | ||
63 | u32 b_low; | ||
64 | u32 b_high; | ||
65 | u32 event_expiration; | ||
66 | u16 pwr_jmp; | ||
67 | }; | ||
68 | |||
69 | #define MT_DFS_CHECK_EVENT(x) ((x) != GENMASK(31, 0)) | ||
70 | #define MT_DFS_EVENT_ENGINE(x) (((x) & BIT(31)) ? 2 : 0) | ||
71 | #define MT_DFS_EVENT_TIMESTAMP(x) ((x) & GENMASK(21, 0)) | ||
72 | #define MT_DFS_EVENT_WIDTH(x) ((x) & GENMASK(11, 0)) | ||
73 | struct mt76x2_dfs_event { | ||
74 | unsigned long fetch_ts; | ||
75 | u32 ts; | ||
76 | u16 width; | ||
77 | u8 engine; | ||
78 | }; | ||
79 | |||
80 | #define MT_DFS_EVENT_BUFLEN 256 | ||
81 | struct mt76x2_dfs_event_rb { | ||
82 | struct mt76x2_dfs_event data[MT_DFS_EVENT_BUFLEN]; | ||
83 | int h_rb, t_rb; | ||
84 | }; | ||
85 | |||
86 | struct mt76x2_dfs_sequence { | ||
87 | struct list_head head; | ||
88 | u32 first_ts; | ||
89 | u32 last_ts; | ||
90 | u32 pri; | ||
91 | u16 count; | ||
92 | u8 engine; | ||
93 | }; | ||
94 | |||
95 | struct mt76x2_dfs_hw_pulse { | ||
96 | u8 engine; | ||
97 | u32 period; | ||
98 | u32 w1; | ||
99 | u32 w2; | ||
100 | u32 burst; | ||
101 | }; | ||
102 | |||
103 | struct mt76x2_dfs_sw_detector_params { | ||
104 | u32 min_pri; | ||
105 | u32 max_pri; | ||
106 | u32 pri_margin; | ||
107 | }; | ||
108 | |||
109 | struct mt76x2_dfs_engine_stats { | ||
110 | u32 hw_pattern; | ||
111 | u32 hw_pulse_discarded; | ||
112 | u32 sw_pattern; | ||
113 | }; | ||
114 | |||
115 | struct mt76x2_dfs_seq_stats { | ||
116 | u32 seq_pool_len; | ||
117 | u32 seq_len; | ||
118 | }; | ||
119 | |||
120 | struct mt76x2_dfs_pattern_detector { | ||
121 | enum nl80211_dfs_regions region; | ||
122 | |||
123 | u8 chirp_pulse_cnt; | ||
124 | u32 chirp_pulse_ts; | ||
125 | |||
126 | struct mt76x2_dfs_sw_detector_params sw_dpd_params; | ||
127 | struct mt76x2_dfs_event_rb event_rb[2]; | ||
128 | |||
129 | struct list_head sequences; | ||
130 | struct list_head seq_pool; | ||
131 | struct mt76x2_dfs_seq_stats seq_stats; | ||
132 | |||
133 | unsigned long last_sw_check; | ||
134 | u32 last_event_ts; | ||
135 | |||
136 | struct mt76x2_dfs_engine_stats stats[MT_DFS_NUM_ENGINES]; | ||
137 | struct tasklet_struct dfs_tasklet; | ||
138 | }; | ||
139 | |||
140 | void mt76x2_dfs_init_params(struct mt76x2_dev *dev); | ||
141 | void mt76x2_dfs_init_detector(struct mt76x2_dev *dev); | ||
142 | void mt76x2_dfs_adjust_agc(struct mt76x2_dev *dev); | ||
143 | void mt76x2_dfs_set_domain(struct mt76x2_dev *dev, | ||
144 | enum nl80211_dfs_regions region); | 24 | enum nl80211_dfs_regions region); |
145 | 25 | ||
146 | #endif /* __MT76x2_DFS_H */ | 26 | #endif /* __DFS_H */ |
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/eeprom.c b/drivers/net/wireless/mediatek/mt76/mt76x2/eeprom.c index 55eda67f0e79..bbab021b5f1a 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2/eeprom.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x2/eeprom.c | |||
@@ -22,7 +22,7 @@ | |||
22 | #define EE_FIELD(_name, _value) [MT_EE_##_name] = (_value) | 1 | 22 | #define EE_FIELD(_name, _value) [MT_EE_##_name] = (_value) | 1 |
23 | 23 | ||
24 | static int | 24 | static int |
25 | mt76x2_eeprom_copy(struct mt76x2_dev *dev, enum mt76x02_eeprom_field field, | 25 | mt76x2_eeprom_copy(struct mt76x02_dev *dev, enum mt76x02_eeprom_field field, |
26 | void *dest, int len) | 26 | void *dest, int len) |
27 | { | 27 | { |
28 | if (field + len > dev->mt76.eeprom.size) | 28 | if (field + len > dev->mt76.eeprom.size) |
@@ -33,7 +33,7 @@ mt76x2_eeprom_copy(struct mt76x2_dev *dev, enum mt76x02_eeprom_field field, | |||
33 | } | 33 | } |
34 | 34 | ||
35 | static int | 35 | static int |
36 | mt76x2_eeprom_get_macaddr(struct mt76x2_dev *dev) | 36 | mt76x2_eeprom_get_macaddr(struct mt76x02_dev *dev) |
37 | { | 37 | { |
38 | void *src = dev->mt76.eeprom.data + MT_EE_MAC_ADDR; | 38 | void *src = dev->mt76.eeprom.data + MT_EE_MAC_ADDR; |
39 | 39 | ||
@@ -42,7 +42,7 @@ mt76x2_eeprom_get_macaddr(struct mt76x2_dev *dev) | |||
42 | } | 42 | } |
43 | 43 | ||
44 | static bool | 44 | static bool |
45 | mt76x2_has_cal_free_data(struct mt76x2_dev *dev, u8 *efuse) | 45 | mt76x2_has_cal_free_data(struct mt76x02_dev *dev, u8 *efuse) |
46 | { | 46 | { |
47 | u16 *efuse_w = (u16 *) efuse; | 47 | u16 *efuse_w = (u16 *) efuse; |
48 | 48 | ||
@@ -68,7 +68,7 @@ mt76x2_has_cal_free_data(struct mt76x2_dev *dev, u8 *efuse) | |||
68 | } | 68 | } |
69 | 69 | ||
70 | static void | 70 | static void |
71 | mt76x2_apply_cal_free_data(struct mt76x2_dev *dev, u8 *efuse) | 71 | mt76x2_apply_cal_free_data(struct mt76x02_dev *dev, u8 *efuse) |
72 | { | 72 | { |
73 | #define GROUP_5G(_id) \ | 73 | #define GROUP_5G(_id) \ |
74 | MT_EE_TX_POWER_0_START_5G + MT_TX_POWER_GROUP_SIZE_5G * (_id), \ | 74 | MT_EE_TX_POWER_0_START_5G + MT_TX_POWER_GROUP_SIZE_5G * (_id), \ |
@@ -137,7 +137,7 @@ mt76x2_apply_cal_free_data(struct mt76x2_dev *dev, u8 *efuse) | |||
137 | eeprom[MT_EE_BT_PMUCFG] = val & 0xff; | 137 | eeprom[MT_EE_BT_PMUCFG] = val & 0xff; |
138 | } | 138 | } |
139 | 139 | ||
140 | static int mt76x2_check_eeprom(struct mt76x2_dev *dev) | 140 | static int mt76x2_check_eeprom(struct mt76x02_dev *dev) |
141 | { | 141 | { |
142 | u16 val = get_unaligned_le16(dev->mt76.eeprom.data); | 142 | u16 val = get_unaligned_le16(dev->mt76.eeprom.data); |
143 | 143 | ||
@@ -155,7 +155,7 @@ static int mt76x2_check_eeprom(struct mt76x2_dev *dev) | |||
155 | } | 155 | } |
156 | 156 | ||
157 | static int | 157 | static int |
158 | mt76x2_eeprom_load(struct mt76x2_dev *dev) | 158 | mt76x2_eeprom_load(struct mt76x02_dev *dev) |
159 | { | 159 | { |
160 | void *efuse; | 160 | void *efuse; |
161 | bool found; | 161 | bool found; |
@@ -197,7 +197,7 @@ out: | |||
197 | } | 197 | } |
198 | 198 | ||
199 | static void | 199 | static void |
200 | mt76x2_set_rx_gain_group(struct mt76x2_dev *dev, u8 val) | 200 | mt76x2_set_rx_gain_group(struct mt76x02_dev *dev, u8 val) |
201 | { | 201 | { |
202 | s8 *dest = dev->cal.rx.high_gain; | 202 | s8 *dest = dev->cal.rx.high_gain; |
203 | 203 | ||
@@ -212,7 +212,7 @@ mt76x2_set_rx_gain_group(struct mt76x2_dev *dev, u8 val) | |||
212 | } | 212 | } |
213 | 213 | ||
214 | static void | 214 | static void |
215 | mt76x2_set_rssi_offset(struct mt76x2_dev *dev, int chain, u8 val) | 215 | mt76x2_set_rssi_offset(struct mt76x02_dev *dev, int chain, u8 val) |
216 | { | 216 | { |
217 | s8 *dest = dev->cal.rx.rssi_offset; | 217 | s8 *dest = dev->cal.rx.rssi_offset; |
218 | 218 | ||
@@ -241,7 +241,7 @@ mt76x2_get_cal_channel_group(int channel) | |||
241 | } | 241 | } |
242 | 242 | ||
243 | static u8 | 243 | static u8 |
244 | mt76x2_get_5g_rx_gain(struct mt76x2_dev *dev, u8 channel) | 244 | mt76x2_get_5g_rx_gain(struct mt76x02_dev *dev, u8 channel) |
245 | { | 245 | { |
246 | enum mt76x2_cal_channel_group group; | 246 | enum mt76x2_cal_channel_group group; |
247 | 247 | ||
@@ -268,7 +268,7 @@ mt76x2_get_5g_rx_gain(struct mt76x2_dev *dev, u8 channel) | |||
268 | } | 268 | } |
269 | } | 269 | } |
270 | 270 | ||
271 | void mt76x2_read_rx_gain(struct mt76x2_dev *dev) | 271 | void mt76x2_read_rx_gain(struct mt76x02_dev *dev) |
272 | { | 272 | { |
273 | struct ieee80211_channel *chan = dev->mt76.chandef.chan; | 273 | struct ieee80211_channel *chan = dev->mt76.chandef.chan; |
274 | int channel = chan->hw_value; | 274 | int channel = chan->hw_value; |
@@ -298,7 +298,7 @@ void mt76x2_read_rx_gain(struct mt76x2_dev *dev) | |||
298 | } | 298 | } |
299 | EXPORT_SYMBOL_GPL(mt76x2_read_rx_gain); | 299 | EXPORT_SYMBOL_GPL(mt76x2_read_rx_gain); |
300 | 300 | ||
301 | void mt76x2_get_rate_power(struct mt76x2_dev *dev, struct mt76_rate_power *t, | 301 | void mt76x2_get_rate_power(struct mt76x02_dev *dev, struct mt76_rate_power *t, |
302 | struct ieee80211_channel *chan) | 302 | struct ieee80211_channel *chan) |
303 | { | 303 | { |
304 | bool is_5ghz; | 304 | bool is_5ghz; |
@@ -366,8 +366,10 @@ void mt76x2_get_rate_power(struct mt76x2_dev *dev, struct mt76_rate_power *t, | |||
366 | EXPORT_SYMBOL_GPL(mt76x2_get_rate_power); | 366 | EXPORT_SYMBOL_GPL(mt76x2_get_rate_power); |
367 | 367 | ||
368 | static void | 368 | static void |
369 | mt76x2_get_power_info_2g(struct mt76x2_dev *dev, struct mt76x2_tx_power_info *t, | 369 | mt76x2_get_power_info_2g(struct mt76x02_dev *dev, |
370 | struct ieee80211_channel *chan, int chain, int offset) | 370 | struct mt76x2_tx_power_info *t, |
371 | struct ieee80211_channel *chan, | ||
372 | int chain, int offset) | ||
371 | { | 373 | { |
372 | int channel = chan->hw_value; | 374 | int channel = chan->hw_value; |
373 | int delta_idx; | 375 | int delta_idx; |
@@ -393,8 +395,10 @@ mt76x2_get_power_info_2g(struct mt76x2_dev *dev, struct mt76x2_tx_power_info *t, | |||
393 | } | 395 | } |
394 | 396 | ||
395 | static void | 397 | static void |
396 | mt76x2_get_power_info_5g(struct mt76x2_dev *dev, struct mt76x2_tx_power_info *t, | 398 | mt76x2_get_power_info_5g(struct mt76x02_dev *dev, |
397 | struct ieee80211_channel *chan, int chain, int offset) | 399 | struct mt76x2_tx_power_info *t, |
400 | struct ieee80211_channel *chan, | ||
401 | int chain, int offset) | ||
398 | { | 402 | { |
399 | int channel = chan->hw_value; | 403 | int channel = chan->hw_value; |
400 | enum mt76x2_cal_channel_group group; | 404 | enum mt76x2_cal_channel_group group; |
@@ -441,7 +445,7 @@ mt76x2_get_power_info_5g(struct mt76x2_dev *dev, struct mt76x2_tx_power_info *t, | |||
441 | t->target_power = val & 0xff; | 445 | t->target_power = val & 0xff; |
442 | } | 446 | } |
443 | 447 | ||
444 | void mt76x2_get_power_info(struct mt76x2_dev *dev, | 448 | void mt76x2_get_power_info(struct mt76x02_dev *dev, |
445 | struct mt76x2_tx_power_info *t, | 449 | struct mt76x2_tx_power_info *t, |
446 | struct ieee80211_channel *chan) | 450 | struct ieee80211_channel *chan) |
447 | { | 451 | { |
@@ -474,7 +478,7 @@ void mt76x2_get_power_info(struct mt76x2_dev *dev, | |||
474 | } | 478 | } |
475 | EXPORT_SYMBOL_GPL(mt76x2_get_power_info); | 479 | EXPORT_SYMBOL_GPL(mt76x2_get_power_info); |
476 | 480 | ||
477 | int mt76x2_get_temp_comp(struct mt76x2_dev *dev, struct mt76x2_temp_comp *t) | 481 | int mt76x2_get_temp_comp(struct mt76x02_dev *dev, struct mt76x2_temp_comp *t) |
478 | { | 482 | { |
479 | enum nl80211_band band = dev->mt76.chandef.chan->band; | 483 | enum nl80211_band band = dev->mt76.chandef.chan->band; |
480 | u16 val, slope; | 484 | u16 val, slope; |
@@ -511,7 +515,7 @@ int mt76x2_get_temp_comp(struct mt76x2_dev *dev, struct mt76x2_temp_comp *t) | |||
511 | } | 515 | } |
512 | EXPORT_SYMBOL_GPL(mt76x2_get_temp_comp); | 516 | EXPORT_SYMBOL_GPL(mt76x2_get_temp_comp); |
513 | 517 | ||
514 | int mt76x2_eeprom_init(struct mt76x2_dev *dev) | 518 | int mt76x2_eeprom_init(struct mt76x02_dev *dev) |
515 | { | 519 | { |
516 | int ret; | 520 | int ret; |
517 | 521 | ||
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/eeprom.h b/drivers/net/wireless/mediatek/mt76/mt76x2/eeprom.h index 33277c7bca9c..c97b31c77d83 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2/eeprom.h +++ b/drivers/net/wireless/mediatek/mt76/mt76x2/eeprom.h | |||
@@ -51,16 +51,16 @@ struct mt76x2_temp_comp { | |||
51 | unsigned int low_slope; /* J / dB */ | 51 | unsigned int low_slope; /* J / dB */ |
52 | }; | 52 | }; |
53 | 53 | ||
54 | void mt76x2_get_rate_power(struct mt76x2_dev *dev, struct mt76_rate_power *t, | 54 | void mt76x2_get_rate_power(struct mt76x02_dev *dev, struct mt76_rate_power *t, |
55 | struct ieee80211_channel *chan); | 55 | struct ieee80211_channel *chan); |
56 | void mt76x2_get_power_info(struct mt76x2_dev *dev, | 56 | void mt76x2_get_power_info(struct mt76x02_dev *dev, |
57 | struct mt76x2_tx_power_info *t, | 57 | struct mt76x2_tx_power_info *t, |
58 | struct ieee80211_channel *chan); | 58 | struct ieee80211_channel *chan); |
59 | int mt76x2_get_temp_comp(struct mt76x2_dev *dev, struct mt76x2_temp_comp *t); | 59 | int mt76x2_get_temp_comp(struct mt76x02_dev *dev, struct mt76x2_temp_comp *t); |
60 | void mt76x2_read_rx_gain(struct mt76x2_dev *dev); | 60 | void mt76x2_read_rx_gain(struct mt76x02_dev *dev); |
61 | 61 | ||
62 | static inline bool | 62 | static inline bool |
63 | mt76x2_has_ext_lna(struct mt76x2_dev *dev) | 63 | mt76x2_has_ext_lna(struct mt76x02_dev *dev) |
64 | { | 64 | { |
65 | u32 val = mt76x02_eeprom_get(&dev->mt76, MT_EE_NIC_CONF_1); | 65 | u32 val = mt76x02_eeprom_get(&dev->mt76, MT_EE_NIC_CONF_1); |
66 | 66 | ||
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/init.c b/drivers/net/wireless/mediatek/mt76/mt76x2/init.c index d672771963d5..ccd9bc9d3e1e 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2/init.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x2/init.c | |||
@@ -20,7 +20,7 @@ | |||
20 | #include "../mt76x02_phy.h" | 20 | #include "../mt76x02_phy.h" |
21 | 21 | ||
22 | static void | 22 | static void |
23 | mt76x2_set_wlan_state(struct mt76x2_dev *dev, bool enable) | 23 | mt76x2_set_wlan_state(struct mt76x02_dev *dev, bool enable) |
24 | { | 24 | { |
25 | u32 val = mt76_rr(dev, MT_WLAN_FUN_CTRL); | 25 | u32 val = mt76_rr(dev, MT_WLAN_FUN_CTRL); |
26 | 26 | ||
@@ -35,7 +35,7 @@ mt76x2_set_wlan_state(struct mt76x2_dev *dev, bool enable) | |||
35 | udelay(20); | 35 | udelay(20); |
36 | } | 36 | } |
37 | 37 | ||
38 | void mt76x2_reset_wlan(struct mt76x2_dev *dev, bool enable) | 38 | void mt76x2_reset_wlan(struct mt76x02_dev *dev, bool enable) |
39 | { | 39 | { |
40 | u32 val; | 40 | u32 val; |
41 | 41 | ||
@@ -62,7 +62,7 @@ out: | |||
62 | } | 62 | } |
63 | EXPORT_SYMBOL_GPL(mt76x2_reset_wlan); | 63 | EXPORT_SYMBOL_GPL(mt76x2_reset_wlan); |
64 | 64 | ||
65 | void mt76_write_mac_initvals(struct mt76x2_dev *dev) | 65 | void mt76_write_mac_initvals(struct mt76x02_dev *dev) |
66 | { | 66 | { |
67 | #define DEFAULT_PROT_CFG_CCK \ | 67 | #define DEFAULT_PROT_CFG_CCK \ |
68 | (FIELD_PREP(MT_PROT_CFG_RATE, 0x3) | \ | 68 | (FIELD_PREP(MT_PROT_CFG_RATE, 0x3) | \ |
@@ -158,7 +158,7 @@ void mt76_write_mac_initvals(struct mt76x2_dev *dev) | |||
158 | } | 158 | } |
159 | EXPORT_SYMBOL_GPL(mt76_write_mac_initvals); | 159 | EXPORT_SYMBOL_GPL(mt76_write_mac_initvals); |
160 | 160 | ||
161 | void mt76x2_init_device(struct mt76x2_dev *dev) | 161 | void mt76x2_init_device(struct mt76x02_dev *dev) |
162 | { | 162 | { |
163 | struct ieee80211_hw *hw = mt76_hw(dev); | 163 | struct ieee80211_hw *hw = mt76_hw(dev); |
164 | 164 | ||
@@ -187,7 +187,7 @@ void mt76x2_init_device(struct mt76x2_dev *dev) | |||
187 | } | 187 | } |
188 | EXPORT_SYMBOL_GPL(mt76x2_init_device); | 188 | EXPORT_SYMBOL_GPL(mt76x2_init_device); |
189 | 189 | ||
190 | void mt76x2_init_txpower(struct mt76x2_dev *dev, | 190 | void mt76x2_init_txpower(struct mt76x02_dev *dev, |
191 | struct ieee80211_supported_band *sband) | 191 | struct ieee80211_supported_band *sband) |
192 | { | 192 | { |
193 | struct ieee80211_channel *chan; | 193 | struct ieee80211_channel *chan; |
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/mac.c b/drivers/net/wireless/mediatek/mt76/mt76x2/mac.c index 93bf8a9404b1..7aefe72fc506 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x2/mac.c | |||
@@ -18,7 +18,7 @@ | |||
18 | #include "mt76x2.h" | 18 | #include "mt76x2.h" |
19 | #include "../mt76x02_util.h" | 19 | #include "../mt76x02_util.h" |
20 | 20 | ||
21 | void mt76x2_mac_stop(struct mt76x2_dev *dev, bool force) | 21 | void mt76x2_mac_stop(struct mt76x02_dev *dev, bool force) |
22 | { | 22 | { |
23 | bool stopped = false; | 23 | bool stopped = false; |
24 | u32 rts_cfg; | 24 | u32 rts_cfg; |
@@ -54,9 +54,9 @@ void mt76x2_mac_stop(struct mt76x2_dev *dev, bool force) | |||
54 | } | 54 | } |
55 | EXPORT_SYMBOL_GPL(mt76x2_mac_stop); | 55 | EXPORT_SYMBOL_GPL(mt76x2_mac_stop); |
56 | 56 | ||
57 | int mt76x2_mac_get_rssi(struct mt76x2_dev *dev, s8 rssi, int chain) | 57 | int mt76x2_mac_get_rssi(struct mt76x02_dev *dev, s8 rssi, int chain) |
58 | { | 58 | { |
59 | struct mt76x2_rx_freq_cal *cal = &dev->cal.rx; | 59 | struct mt76x02_rx_freq_cal *cal = &dev->cal.rx; |
60 | 60 | ||
61 | rssi += cal->rssi_offset[chain]; | 61 | rssi += cal->rssi_offset[chain]; |
62 | rssi -= cal->lna_gain; | 62 | rssi -= cal->lna_gain; |
@@ -64,7 +64,7 @@ int mt76x2_mac_get_rssi(struct mt76x2_dev *dev, s8 rssi, int chain) | |||
64 | return rssi; | 64 | return rssi; |
65 | } | 65 | } |
66 | 66 | ||
67 | int mt76x2_mac_process_rx(struct mt76x2_dev *dev, struct sk_buff *skb, | 67 | int mt76x2_mac_process_rx(struct mt76x02_dev *dev, struct sk_buff *skb, |
68 | void *rxi) | 68 | void *rxi) |
69 | { | 69 | { |
70 | struct mt76_rx_status *status = (struct mt76_rx_status *) skb->cb; | 70 | struct mt76_rx_status *status = (struct mt76_rx_status *) skb->cb; |
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/mac.h b/drivers/net/wireless/mediatek/mt76/mt76x2/mac.h index 95ad5eea4274..db36232277cd 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2/mac.h +++ b/drivers/net/wireless/mediatek/mt76/mt76x2/mac.h | |||
@@ -20,7 +20,7 @@ | |||
20 | #include "../mt76.h" | 20 | #include "../mt76.h" |
21 | #include "../mt76x02_mac.h" | 21 | #include "../mt76x02_mac.h" |
22 | 22 | ||
23 | struct mt76x2_dev; | 23 | struct mt76x02_dev; |
24 | struct mt76x2_sta; | 24 | struct mt76x2_sta; |
25 | struct mt76x02_vif; | 25 | struct mt76x02_vif; |
26 | 26 | ||
@@ -41,20 +41,20 @@ mt76x2_skb_tx_info(struct sk_buff *skb) | |||
41 | return (void *) info->status.status_driver_data; | 41 | return (void *) info->status.status_driver_data; |
42 | } | 42 | } |
43 | 43 | ||
44 | int mt76x2_mac_start(struct mt76x2_dev *dev); | 44 | int mt76x2_mac_start(struct mt76x02_dev *dev); |
45 | void mt76x2_mac_stop(struct mt76x2_dev *dev, bool force); | 45 | void mt76x2_mac_stop(struct mt76x02_dev *dev, bool force); |
46 | void mt76x2_mac_resume(struct mt76x2_dev *dev); | 46 | void mt76x2_mac_resume(struct mt76x02_dev *dev); |
47 | void mt76x2_mac_set_bssid(struct mt76x2_dev *dev, u8 idx, const u8 *addr); | 47 | void mt76x2_mac_set_bssid(struct mt76x02_dev *dev, u8 idx, const u8 *addr); |
48 | 48 | ||
49 | int mt76x2_mac_process_rx(struct mt76x2_dev *dev, struct sk_buff *skb, | 49 | int mt76x2_mac_process_rx(struct mt76x02_dev *dev, struct sk_buff *skb, |
50 | void *rxi); | 50 | void *rxi); |
51 | 51 | ||
52 | int mt76x2_mac_set_beacon(struct mt76x2_dev *dev, u8 vif_idx, | 52 | int mt76x2_mac_set_beacon(struct mt76x02_dev *dev, u8 vif_idx, |
53 | struct sk_buff *skb); | 53 | struct sk_buff *skb); |
54 | void mt76x2_mac_set_beacon_enable(struct mt76x2_dev *dev, u8 vif_idx, bool val); | 54 | void mt76x2_mac_set_beacon_enable(struct mt76x02_dev *dev, u8 vif_idx, bool val); |
55 | 55 | ||
56 | void mt76x2_mac_poll_tx_status(struct mt76x2_dev *dev, bool irq); | 56 | void mt76x2_mac_poll_tx_status(struct mt76x02_dev *dev, bool irq); |
57 | void mt76x2_mac_process_tx_status_fifo(struct mt76x2_dev *dev); | 57 | void mt76x2_mac_process_tx_status_fifo(struct mt76x02_dev *dev); |
58 | 58 | ||
59 | void mt76x2_mac_work(struct work_struct *work); | 59 | void mt76x2_mac_work(struct work_struct *work); |
60 | 60 | ||
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/mcu.c b/drivers/net/wireless/mediatek/mt76/mt76x2/mcu.c index 86b09534326e..7d944f50956a 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x2/mcu.c | |||
@@ -24,7 +24,7 @@ | |||
24 | #include "eeprom.h" | 24 | #include "eeprom.h" |
25 | #include "../mt76x02_dma.h" | 25 | #include "../mt76x02_dma.h" |
26 | 26 | ||
27 | int mt76x2_mcu_set_channel(struct mt76x2_dev *dev, u8 channel, u8 bw, | 27 | int mt76x2_mcu_set_channel(struct mt76x02_dev *dev, u8 channel, u8 bw, |
28 | u8 bw_index, bool scan) | 28 | u8 bw_index, bool scan) |
29 | { | 29 | { |
30 | struct sk_buff *skb; | 30 | struct sk_buff *skb; |
@@ -57,7 +57,7 @@ int mt76x2_mcu_set_channel(struct mt76x2_dev *dev, u8 channel, u8 bw, | |||
57 | } | 57 | } |
58 | EXPORT_SYMBOL_GPL(mt76x2_mcu_set_channel); | 58 | EXPORT_SYMBOL_GPL(mt76x2_mcu_set_channel); |
59 | 59 | ||
60 | int mt76x2_mcu_load_cr(struct mt76x2_dev *dev, u8 type, u8 temp_level, | 60 | int mt76x2_mcu_load_cr(struct mt76x02_dev *dev, u8 type, u8 temp_level, |
61 | u8 channel) | 61 | u8 channel) |
62 | { | 62 | { |
63 | struct mt76_dev *mdev = &dev->mt76; | 63 | struct mt76_dev *mdev = &dev->mt76; |
@@ -87,7 +87,7 @@ int mt76x2_mcu_load_cr(struct mt76x2_dev *dev, u8 type, u8 temp_level, | |||
87 | } | 87 | } |
88 | EXPORT_SYMBOL_GPL(mt76x2_mcu_load_cr); | 88 | EXPORT_SYMBOL_GPL(mt76x2_mcu_load_cr); |
89 | 89 | ||
90 | int mt76x2_mcu_init_gain(struct mt76x2_dev *dev, u8 channel, u32 gain, | 90 | int mt76x2_mcu_init_gain(struct mt76x02_dev *dev, u8 channel, u32 gain, |
91 | bool force) | 91 | bool force) |
92 | { | 92 | { |
93 | struct sk_buff *skb; | 93 | struct sk_buff *skb; |
@@ -107,7 +107,7 @@ int mt76x2_mcu_init_gain(struct mt76x2_dev *dev, u8 channel, u32 gain, | |||
107 | } | 107 | } |
108 | EXPORT_SYMBOL_GPL(mt76x2_mcu_init_gain); | 108 | EXPORT_SYMBOL_GPL(mt76x2_mcu_init_gain); |
109 | 109 | ||
110 | int mt76x2_mcu_tssi_comp(struct mt76x2_dev *dev, | 110 | int mt76x2_mcu_tssi_comp(struct mt76x02_dev *dev, |
111 | struct mt76x2_tssi_comp *tssi_data) | 111 | struct mt76x2_tssi_comp *tssi_data) |
112 | { | 112 | { |
113 | struct sk_buff *skb; | 113 | struct sk_buff *skb; |
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/mcu.h b/drivers/net/wireless/mediatek/mt76/mt76x2/mcu.h index 98a73e285a45..acfa2b570c7c 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2/mcu.h +++ b/drivers/net/wireless/mediatek/mt76/mt76x2/mcu.h | |||
@@ -94,8 +94,8 @@ struct mt76x2_tssi_comp { | |||
94 | u8 offset1; | 94 | u8 offset1; |
95 | } __packed __aligned(4); | 95 | } __packed __aligned(4); |
96 | 96 | ||
97 | int mt76x2_mcu_tssi_comp(struct mt76x2_dev *dev, struct mt76x2_tssi_comp *tssi_data); | 97 | int mt76x2_mcu_tssi_comp(struct mt76x02_dev *dev, struct mt76x2_tssi_comp *tssi_data); |
98 | int mt76x2_mcu_init_gain(struct mt76x2_dev *dev, u8 channel, u32 gain, | 98 | int mt76x2_mcu_init_gain(struct mt76x02_dev *dev, u8 channel, u32 gain, |
99 | bool force); | 99 | bool force); |
100 | 100 | ||
101 | #endif | 101 | #endif |
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/mt76x2.h b/drivers/net/wireless/mediatek/mt76/mt76x2/mt76x2.h index f9ca93ad91cd..b4de10b7b31e 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2/mt76x2.h +++ b/drivers/net/wireless/mediatek/mt76/mt76x2/mt76x2.h | |||
@@ -26,7 +26,6 @@ | |||
26 | #include <linux/interrupt.h> | 26 | #include <linux/interrupt.h> |
27 | #include <linux/mutex.h> | 27 | #include <linux/mutex.h> |
28 | #include <linux/bitops.h> | 28 | #include <linux/bitops.h> |
29 | #include <linux/kfifo.h> | ||
30 | 29 | ||
31 | #define MT7662_FIRMWARE "mt7662.bin" | 30 | #define MT7662_FIRMWARE "mt7662.bin" |
32 | #define MT7662_ROM_PATCH "mt7662_rom_patch.bin" | 31 | #define MT7662_ROM_PATCH "mt7662_rom_patch.bin" |
@@ -35,86 +34,20 @@ | |||
35 | #define MT7662U_FIRMWARE "mediatek/mt7662u.bin" | 34 | #define MT7662U_FIRMWARE "mediatek/mt7662u.bin" |
36 | #define MT7662U_ROM_PATCH "mediatek/mt7662u_rom_patch.bin" | 35 | #define MT7662U_ROM_PATCH "mediatek/mt7662u_rom_patch.bin" |
37 | 36 | ||
38 | #define MT_MAX_CHAINS 2 | ||
39 | |||
40 | #define MT_CALIBRATE_INTERVAL HZ | 37 | #define MT_CALIBRATE_INTERVAL HZ |
41 | 38 | ||
42 | #include "../mt76.h" | 39 | #include "../mt76.h" |
43 | #include "../mt76x02_regs.h" | 40 | #include "../mt76x02_regs.h" |
41 | #include "../mt76x02_util.h" | ||
44 | #include "mac.h" | 42 | #include "mac.h" |
45 | #include "dfs.h" | 43 | #include "dfs.h" |
46 | 44 | ||
47 | struct mt76x2_rx_freq_cal { | 45 | static inline bool is_mt7612(struct mt76x02_dev *dev) |
48 | s8 high_gain[MT_MAX_CHAINS]; | ||
49 | s8 rssi_offset[MT_MAX_CHAINS]; | ||
50 | s8 lna_gain; | ||
51 | u32 mcu_gain; | ||
52 | }; | ||
53 | |||
54 | struct mt76x2_calibration { | ||
55 | struct mt76x2_rx_freq_cal rx; | ||
56 | |||
57 | u8 agc_gain_init[MT_MAX_CHAINS]; | ||
58 | u8 agc_gain_cur[MT_MAX_CHAINS]; | ||
59 | |||
60 | u16 false_cca; | ||
61 | s8 avg_rssi_all; | ||
62 | s8 agc_gain_adjust; | ||
63 | s8 low_gain; | ||
64 | |||
65 | u8 temp; | ||
66 | |||
67 | bool init_cal_done; | ||
68 | bool tssi_cal_done; | ||
69 | bool tssi_comp_pending; | ||
70 | bool dpd_cal_done; | ||
71 | bool channel_cal_done; | ||
72 | }; | ||
73 | |||
74 | struct mt76x2_dev { | ||
75 | struct mt76_dev mt76; /* must be first */ | ||
76 | |||
77 | struct mac_address macaddr_list[8]; | ||
78 | |||
79 | struct mutex mutex; | ||
80 | |||
81 | u8 txdone_seq; | ||
82 | DECLARE_KFIFO_PTR(txstatus_fifo, struct mt76x02_tx_status); | ||
83 | |||
84 | struct sk_buff *rx_head; | ||
85 | |||
86 | struct tasklet_struct tx_tasklet; | ||
87 | struct tasklet_struct pre_tbtt_tasklet; | ||
88 | struct delayed_work cal_work; | ||
89 | struct delayed_work mac_work; | ||
90 | |||
91 | u32 aggr_stats[32]; | ||
92 | |||
93 | struct sk_buff *beacons[8]; | ||
94 | u8 beacon_mask; | ||
95 | u8 beacon_data_mask; | ||
96 | |||
97 | u8 tbtt_count; | ||
98 | u16 beacon_int; | ||
99 | |||
100 | struct mt76x2_calibration cal; | ||
101 | |||
102 | s8 target_power; | ||
103 | s8 target_power_delta[2]; | ||
104 | bool enable_tpc; | ||
105 | |||
106 | u8 coverage_class; | ||
107 | u8 slottime; | ||
108 | |||
109 | struct mt76x2_dfs_pattern_detector dfs_pd; | ||
110 | }; | ||
111 | |||
112 | static inline bool is_mt7612(struct mt76x2_dev *dev) | ||
113 | { | 46 | { |
114 | return mt76_chip(&dev->mt76) == 0x7612; | 47 | return mt76_chip(&dev->mt76) == 0x7612; |
115 | } | 48 | } |
116 | 49 | ||
117 | static inline bool mt76x2_channel_silent(struct mt76x2_dev *dev) | 50 | static inline bool mt76x2_channel_silent(struct mt76x02_dev *dev) |
118 | { | 51 | { |
119 | struct ieee80211_channel *chan = dev->mt76.chandef.chan; | 52 | struct ieee80211_channel *chan = dev->mt76.chandef.chan; |
120 | 53 | ||
@@ -124,37 +57,37 @@ static inline bool mt76x2_channel_silent(struct mt76x2_dev *dev) | |||
124 | 57 | ||
125 | extern const struct ieee80211_ops mt76x2_ops; | 58 | extern const struct ieee80211_ops mt76x2_ops; |
126 | 59 | ||
127 | struct mt76x2_dev *mt76x2_alloc_device(struct device *pdev); | 60 | struct mt76x02_dev *mt76x2_alloc_device(struct device *pdev); |
128 | int mt76x2_register_device(struct mt76x2_dev *dev); | 61 | int mt76x2_register_device(struct mt76x02_dev *dev); |
129 | void mt76x2_init_debugfs(struct mt76x2_dev *dev); | 62 | void mt76x2_init_debugfs(struct mt76x02_dev *dev); |
130 | void mt76x2_init_device(struct mt76x2_dev *dev); | 63 | void mt76x2_init_device(struct mt76x02_dev *dev); |
131 | 64 | ||
132 | irqreturn_t mt76x2_irq_handler(int irq, void *dev_instance); | 65 | irqreturn_t mt76x2_irq_handler(int irq, void *dev_instance); |
133 | void mt76x2_phy_power_on(struct mt76x2_dev *dev); | 66 | void mt76x2_phy_power_on(struct mt76x02_dev *dev); |
134 | int mt76x2_init_hardware(struct mt76x2_dev *dev); | 67 | int mt76x2_init_hardware(struct mt76x02_dev *dev); |
135 | void mt76x2_stop_hardware(struct mt76x2_dev *dev); | 68 | void mt76x2_stop_hardware(struct mt76x02_dev *dev); |
136 | int mt76x2_eeprom_init(struct mt76x2_dev *dev); | 69 | int mt76x2_eeprom_init(struct mt76x02_dev *dev); |
137 | int mt76x2_apply_calibration_data(struct mt76x2_dev *dev, int channel); | 70 | int mt76x2_apply_calibration_data(struct mt76x02_dev *dev, int channel); |
138 | void mt76x2_set_tx_ackto(struct mt76x2_dev *dev); | 71 | void mt76x2_set_tx_ackto(struct mt76x02_dev *dev); |
139 | 72 | ||
140 | void mt76x2_phy_set_antenna(struct mt76x2_dev *dev); | 73 | void mt76x2_phy_set_antenna(struct mt76x02_dev *dev); |
141 | int mt76x2_phy_start(struct mt76x2_dev *dev); | 74 | int mt76x2_phy_start(struct mt76x02_dev *dev); |
142 | int mt76x2_phy_set_channel(struct mt76x2_dev *dev, | 75 | int mt76x2_phy_set_channel(struct mt76x02_dev *dev, |
143 | struct cfg80211_chan_def *chandef); | 76 | struct cfg80211_chan_def *chandef); |
144 | int mt76x2_mac_get_rssi(struct mt76x2_dev *dev, s8 rssi, int chain); | 77 | int mt76x2_mac_get_rssi(struct mt76x02_dev *dev, s8 rssi, int chain); |
145 | void mt76x2_phy_calibrate(struct work_struct *work); | 78 | void mt76x2_phy_calibrate(struct work_struct *work); |
146 | void mt76x2_phy_set_txpower(struct mt76x2_dev *dev); | 79 | void mt76x2_phy_set_txpower(struct mt76x02_dev *dev); |
147 | 80 | ||
148 | int mt76x2_mcu_init(struct mt76x2_dev *dev); | 81 | int mt76x2_mcu_init(struct mt76x02_dev *dev); |
149 | int mt76x2_mcu_set_channel(struct mt76x2_dev *dev, u8 channel, u8 bw, | 82 | int mt76x2_mcu_set_channel(struct mt76x02_dev *dev, u8 channel, u8 bw, |
150 | u8 bw_index, bool scan); | 83 | u8 bw_index, bool scan); |
151 | int mt76x2_mcu_load_cr(struct mt76x2_dev *dev, u8 type, u8 temp_level, | 84 | int mt76x2_mcu_load_cr(struct mt76x02_dev *dev, u8 type, u8 temp_level, |
152 | u8 channel); | 85 | u8 channel); |
153 | 86 | ||
154 | void mt76x2_tx_tasklet(unsigned long data); | 87 | void mt76x2_tx_tasklet(unsigned long data); |
155 | void mt76x2_dma_cleanup(struct mt76x2_dev *dev); | 88 | void mt76x2_dma_cleanup(struct mt76x02_dev *dev); |
156 | 89 | ||
157 | void mt76x2_cleanup(struct mt76x2_dev *dev); | 90 | void mt76x2_cleanup(struct mt76x02_dev *dev); |
158 | 91 | ||
159 | void mt76x2_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control, | 92 | void mt76x2_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control, |
160 | struct sk_buff *skb); | 93 | struct sk_buff *skb); |
@@ -164,7 +97,7 @@ int mt76x2_tx_prepare_skb(struct mt76_dev *mdev, void *txwi, | |||
164 | u32 *tx_info); | 97 | u32 *tx_info); |
165 | void mt76x2_tx_complete_skb(struct mt76_dev *mdev, struct mt76_queue *q, | 98 | void mt76x2_tx_complete_skb(struct mt76_dev *mdev, struct mt76_queue *q, |
166 | struct mt76_queue_entry *e, bool flush); | 99 | struct mt76_queue_entry *e, bool flush); |
167 | void mt76x2_mac_set_tx_protection(struct mt76x2_dev *dev, u32 val); | 100 | void mt76x2_mac_set_tx_protection(struct mt76x02_dev *dev, u32 val); |
168 | 101 | ||
169 | void mt76x2_pre_tbtt_tasklet(unsigned long arg); | 102 | void mt76x2_pre_tbtt_tasklet(unsigned long arg); |
170 | 103 | ||
@@ -177,13 +110,13 @@ void mt76x2_sta_ps(struct mt76_dev *dev, struct ieee80211_sta *sta, bool ps); | |||
177 | void mt76x2_update_channel(struct mt76_dev *mdev); | 110 | void mt76x2_update_channel(struct mt76_dev *mdev); |
178 | 111 | ||
179 | s8 mt76x2_tx_get_txpwr_adj(struct mt76_dev *mdev, s8 txpwr, s8 max_txpwr_adj); | 112 | s8 mt76x2_tx_get_txpwr_adj(struct mt76_dev *mdev, s8 txpwr, s8 max_txpwr_adj); |
180 | void mt76x2_tx_set_txpwr_auto(struct mt76x2_dev *dev, s8 txpwr); | 113 | void mt76x2_tx_set_txpwr_auto(struct mt76x02_dev *dev, s8 txpwr); |
181 | 114 | ||
182 | 115 | ||
183 | void mt76x2_reset_wlan(struct mt76x2_dev *dev, bool enable); | 116 | void mt76x2_reset_wlan(struct mt76x02_dev *dev, bool enable); |
184 | void mt76x2_init_txpower(struct mt76x2_dev *dev, | 117 | void mt76x2_init_txpower(struct mt76x02_dev *dev, |
185 | struct ieee80211_supported_band *sband); | 118 | struct ieee80211_supported_band *sband); |
186 | void mt76_write_mac_initvals(struct mt76x2_dev *dev); | 119 | void mt76_write_mac_initvals(struct mt76x02_dev *dev); |
187 | 120 | ||
188 | int mt76x2_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | 121 | int mt76x2_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
189 | struct ieee80211_sta *sta); | 122 | struct ieee80211_sta *sta); |
@@ -193,15 +126,15 @@ void mt76x2_remove_interface(struct ieee80211_hw *hw, | |||
193 | struct ieee80211_vif *vif); | 126 | struct ieee80211_vif *vif); |
194 | int mt76x2_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | 127 | int mt76x2_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
195 | u16 queue, const struct ieee80211_tx_queue_params *params); | 128 | u16 queue, const struct ieee80211_tx_queue_params *params); |
196 | void mt76x2_txq_init(struct mt76x2_dev *dev, struct ieee80211_txq *txq); | 129 | void mt76x2_txq_init(struct mt76x02_dev *dev, struct ieee80211_txq *txq); |
197 | 130 | ||
198 | void mt76x2_phy_tssi_compensate(struct mt76x2_dev *dev, bool wait); | 131 | void mt76x2_phy_tssi_compensate(struct mt76x02_dev *dev, bool wait); |
199 | void mt76x2_phy_set_txpower_regs(struct mt76x2_dev *dev, | 132 | void mt76x2_phy_set_txpower_regs(struct mt76x02_dev *dev, |
200 | enum nl80211_band band); | 133 | enum nl80211_band band); |
201 | void mt76x2_configure_tx_delay(struct mt76x2_dev *dev, | 134 | void mt76x2_configure_tx_delay(struct mt76x02_dev *dev, |
202 | enum nl80211_band band, u8 bw); | 135 | enum nl80211_band band, u8 bw); |
203 | void mt76x2_phy_set_bw(struct mt76x2_dev *dev, int width, u8 ctrl); | 136 | void mt76x2_phy_set_bw(struct mt76x02_dev *dev, int width, u8 ctrl); |
204 | void mt76x2_phy_set_band(struct mt76x2_dev *dev, int band, bool primary_upper); | 137 | void mt76x2_phy_set_band(struct mt76x02_dev *dev, int band, bool primary_upper); |
205 | void mt76x2_apply_gain_adj(struct mt76x2_dev *dev); | 138 | void mt76x2_apply_gain_adj(struct mt76x02_dev *dev); |
206 | 139 | ||
207 | #endif | 140 | #endif |
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/mt76x2u.h b/drivers/net/wireless/mediatek/mt76/mt76x2/mt76x2u.h index e5d08cc8ca73..b3270b0b0930 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2/mt76x2u.h +++ b/drivers/net/wireless/mediatek/mt76/mt76x2/mt76x2u.h | |||
@@ -30,31 +30,31 @@ | |||
30 | 30 | ||
31 | extern const struct ieee80211_ops mt76x2u_ops; | 31 | extern const struct ieee80211_ops mt76x2u_ops; |
32 | 32 | ||
33 | struct mt76x2_dev *mt76x2u_alloc_device(struct device *pdev); | 33 | struct mt76x02_dev *mt76x2u_alloc_device(struct device *pdev); |
34 | int mt76x2u_register_device(struct mt76x2_dev *dev); | 34 | int mt76x2u_register_device(struct mt76x02_dev *dev); |
35 | int mt76x2u_init_hardware(struct mt76x2_dev *dev); | 35 | int mt76x2u_init_hardware(struct mt76x02_dev *dev); |
36 | void mt76x2u_cleanup(struct mt76x2_dev *dev); | 36 | void mt76x2u_cleanup(struct mt76x02_dev *dev); |
37 | void mt76x2u_stop_hw(struct mt76x2_dev *dev); | 37 | void mt76x2u_stop_hw(struct mt76x02_dev *dev); |
38 | 38 | ||
39 | int mt76x2u_mac_reset(struct mt76x2_dev *dev); | 39 | int mt76x2u_mac_reset(struct mt76x02_dev *dev); |
40 | void mt76x2u_mac_resume(struct mt76x2_dev *dev); | 40 | void mt76x2u_mac_resume(struct mt76x02_dev *dev); |
41 | int mt76x2u_mac_start(struct mt76x2_dev *dev); | 41 | int mt76x2u_mac_start(struct mt76x02_dev *dev); |
42 | int mt76x2u_mac_stop(struct mt76x2_dev *dev); | 42 | int mt76x2u_mac_stop(struct mt76x02_dev *dev); |
43 | 43 | ||
44 | int mt76x2u_phy_set_channel(struct mt76x2_dev *dev, | 44 | int mt76x2u_phy_set_channel(struct mt76x02_dev *dev, |
45 | struct cfg80211_chan_def *chandef); | 45 | struct cfg80211_chan_def *chandef); |
46 | void mt76x2u_phy_calibrate(struct work_struct *work); | 46 | void mt76x2u_phy_calibrate(struct work_struct *work); |
47 | void mt76x2u_phy_channel_calibrate(struct mt76x2_dev *dev); | 47 | void mt76x2u_phy_channel_calibrate(struct mt76x02_dev *dev); |
48 | 48 | ||
49 | void mt76x2u_mcu_complete_urb(struct urb *urb); | 49 | void mt76x2u_mcu_complete_urb(struct urb *urb); |
50 | int mt76x2u_mcu_set_dynamic_vga(struct mt76x2_dev *dev, u8 channel, bool ap, | 50 | int mt76x2u_mcu_set_dynamic_vga(struct mt76x02_dev *dev, u8 channel, bool ap, |
51 | bool ext, int rssi, u32 false_cca); | 51 | bool ext, int rssi, u32 false_cca); |
52 | int mt76x2u_mcu_init(struct mt76x2_dev *dev); | 52 | int mt76x2u_mcu_init(struct mt76x02_dev *dev); |
53 | int mt76x2u_mcu_fw_init(struct mt76x2_dev *dev); | 53 | int mt76x2u_mcu_fw_init(struct mt76x02_dev *dev); |
54 | 54 | ||
55 | int mt76x2u_alloc_queues(struct mt76x2_dev *dev); | 55 | int mt76x2u_alloc_queues(struct mt76x02_dev *dev); |
56 | void mt76x2u_queues_deinit(struct mt76x2_dev *dev); | 56 | void mt76x2u_queues_deinit(struct mt76x02_dev *dev); |
57 | void mt76x2u_stop_queues(struct mt76x2_dev *dev); | 57 | void mt76x2u_stop_queues(struct mt76x02_dev *dev); |
58 | int mt76x2u_skb_dma_info(struct sk_buff *skb, enum dma_msg_port port, | 58 | int mt76x2u_skb_dma_info(struct sk_buff *skb, enum dma_msg_port port, |
59 | u32 flags); | 59 | u32 flags); |
60 | 60 | ||
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/pci.c b/drivers/net/wireless/mediatek/mt76/mt76x2/pci.c index 49556becb72d..1fcf23dad06f 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2/pci.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x2/pci.c | |||
@@ -31,7 +31,7 @@ static const struct pci_device_id mt76pci_device_table[] = { | |||
31 | static int | 31 | static int |
32 | mt76pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) | 32 | mt76pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) |
33 | { | 33 | { |
34 | struct mt76x2_dev *dev; | 34 | struct mt76x02_dev *dev; |
35 | int ret; | 35 | int ret; |
36 | 36 | ||
37 | ret = pcim_enable_device(pdev); | 37 | ret = pcim_enable_device(pdev); |
@@ -89,7 +89,7 @@ static void | |||
89 | mt76pci_remove(struct pci_dev *pdev) | 89 | mt76pci_remove(struct pci_dev *pdev) |
90 | { | 90 | { |
91 | struct mt76_dev *mdev = pci_get_drvdata(pdev); | 91 | struct mt76_dev *mdev = pci_get_drvdata(pdev); |
92 | struct mt76x2_dev *dev = container_of(mdev, struct mt76x2_dev, mt76); | 92 | struct mt76x02_dev *dev = container_of(mdev, struct mt76x02_dev, mt76); |
93 | 93 | ||
94 | mt76_unregister_device(mdev); | 94 | mt76_unregister_device(mdev); |
95 | mt76x2_cleanup(dev); | 95 | mt76x2_cleanup(dev); |
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/pci_core.c b/drivers/net/wireless/mediatek/mt76/mt76x2/pci_core.c index b343742b36ee..6da12fca668c 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2/pci_core.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x2/pci_core.c | |||
@@ -26,7 +26,7 @@ void mt76x2_rx_poll_complete(struct mt76_dev *mdev, enum mt76_rxq_id q) | |||
26 | 26 | ||
27 | irqreturn_t mt76x2_irq_handler(int irq, void *dev_instance) | 27 | irqreturn_t mt76x2_irq_handler(int irq, void *dev_instance) |
28 | { | 28 | { |
29 | struct mt76x2_dev *dev = dev_instance; | 29 | struct mt76x02_dev *dev = dev_instance; |
30 | u32 intr; | 30 | u32 intr; |
31 | 31 | ||
32 | intr = mt76_rr(dev, MT_INT_SOURCE_CSR); | 32 | intr = mt76_rr(dev, MT_INT_SOURCE_CSR); |
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/pci_dfs.c b/drivers/net/wireless/mediatek/mt76/mt76x2/pci_dfs.c index 18926a6478ab..b36286bc8b69 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2/pci_dfs.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x2/pci_dfs.c | |||
@@ -37,7 +37,7 @@ | |||
37 | .pwr_jmp = power_jmp \ | 37 | .pwr_jmp = power_jmp \ |
38 | } | 38 | } |
39 | 39 | ||
40 | static const struct mt76x2_radar_specs etsi_radar_specs[] = { | 40 | static const struct mt76x02_radar_specs etsi_radar_specs[] = { |
41 | /* 20MHz */ | 41 | /* 20MHz */ |
42 | RADAR_SPEC(0, 8, 2, 15, 106, 150, 10, 4900, 100096, 10, 0, | 42 | RADAR_SPEC(0, 8, 2, 15, 106, 150, 10, 4900, 100096, 10, 0, |
43 | 0x7fffffff, 0x155cc0, 0x19cc), | 43 | 0x7fffffff, 0x155cc0, 0x19cc), |
@@ -67,7 +67,7 @@ static const struct mt76x2_radar_specs etsi_radar_specs[] = { | |||
67 | 0x7fffffff, 0x2191c0, 0x15cc) | 67 | 0x7fffffff, 0x2191c0, 0x15cc) |
68 | }; | 68 | }; |
69 | 69 | ||
70 | static const struct mt76x2_radar_specs fcc_radar_specs[] = { | 70 | static const struct mt76x02_radar_specs fcc_radar_specs[] = { |
71 | /* 20MHz */ | 71 | /* 20MHz */ |
72 | RADAR_SPEC(0, 8, 2, 12, 106, 150, 5, 2900, 80100, 5, 0, | 72 | RADAR_SPEC(0, 8, 2, 12, 106, 150, 5, 2900, 80100, 5, 0, |
73 | 0x7fffffff, 0xfe808, 0x13dc), | 73 | 0x7fffffff, 0xfe808, 0x13dc), |
@@ -97,7 +97,7 @@ static const struct mt76x2_radar_specs fcc_radar_specs[] = { | |||
97 | 0x3938700, 0x57bcf00, 0x1289) | 97 | 0x3938700, 0x57bcf00, 0x1289) |
98 | }; | 98 | }; |
99 | 99 | ||
100 | static const struct mt76x2_radar_specs jp_w56_radar_specs[] = { | 100 | static const struct mt76x02_radar_specs jp_w56_radar_specs[] = { |
101 | /* 20MHz */ | 101 | /* 20MHz */ |
102 | RADAR_SPEC(0, 8, 2, 7, 106, 150, 5, 2900, 80100, 5, 0, | 102 | RADAR_SPEC(0, 8, 2, 7, 106, 150, 5, 2900, 80100, 5, 0, |
103 | 0x7fffffff, 0x14c080, 0x13dc), | 103 | 0x7fffffff, 0x14c080, 0x13dc), |
@@ -127,7 +127,7 @@ static const struct mt76x2_radar_specs jp_w56_radar_specs[] = { | |||
127 | 0x3938700, 0X57bcf00, 0x1289) | 127 | 0x3938700, 0X57bcf00, 0x1289) |
128 | }; | 128 | }; |
129 | 129 | ||
130 | static const struct mt76x2_radar_specs jp_w53_radar_specs[] = { | 130 | static const struct mt76x02_radar_specs jp_w53_radar_specs[] = { |
131 | /* 20MHz */ | 131 | /* 20MHz */ |
132 | RADAR_SPEC(0, 8, 2, 9, 106, 150, 20, 28400, 77000, 20, 0, | 132 | RADAR_SPEC(0, 8, 2, 9, 106, 150, 20, 28400, 77000, 20, 0, |
133 | 0x7fffffff, 0x14c080, 0x16cc), | 133 | 0x7fffffff, 0x14c080, 0x16cc), |
@@ -151,8 +151,9 @@ static const struct mt76x2_radar_specs jp_w53_radar_specs[] = { | |||
151 | { 0 } | 151 | { 0 } |
152 | }; | 152 | }; |
153 | 153 | ||
154 | static void mt76x2_dfs_set_capture_mode_ctrl(struct mt76x2_dev *dev, | 154 | static void |
155 | u8 enable) | 155 | mt76x2_dfs_set_capture_mode_ctrl(struct mt76x02_dev *dev, |
156 | u8 enable) | ||
156 | { | 157 | { |
157 | u32 data; | 158 | u32 data; |
158 | 159 | ||
@@ -160,10 +161,10 @@ static void mt76x2_dfs_set_capture_mode_ctrl(struct mt76x2_dev *dev, | |||
160 | mt76_wr(dev, MT_BBP(DFS, 36), data); | 161 | mt76_wr(dev, MT_BBP(DFS, 36), data); |
161 | } | 162 | } |
162 | 163 | ||
163 | static void mt76x2_dfs_seq_pool_put(struct mt76x2_dev *dev, | 164 | static void mt76x2_dfs_seq_pool_put(struct mt76x02_dev *dev, |
164 | struct mt76x2_dfs_sequence *seq) | 165 | struct mt76x02_dfs_sequence *seq) |
165 | { | 166 | { |
166 | struct mt76x2_dfs_pattern_detector *dfs_pd = &dev->dfs_pd; | 167 | struct mt76x02_dfs_pattern_detector *dfs_pd = &dev->dfs_pd; |
167 | 168 | ||
168 | list_add(&seq->head, &dfs_pd->seq_pool); | 169 | list_add(&seq->head, &dfs_pd->seq_pool); |
169 | 170 | ||
@@ -171,17 +172,17 @@ static void mt76x2_dfs_seq_pool_put(struct mt76x2_dev *dev, | |||
171 | dfs_pd->seq_stats.seq_len--; | 172 | dfs_pd->seq_stats.seq_len--; |
172 | } | 173 | } |
173 | 174 | ||
174 | static | 175 | static struct mt76x02_dfs_sequence * |
175 | struct mt76x2_dfs_sequence *mt76x2_dfs_seq_pool_get(struct mt76x2_dev *dev) | 176 | mt76x2_dfs_seq_pool_get(struct mt76x02_dev *dev) |
176 | { | 177 | { |
177 | struct mt76x2_dfs_pattern_detector *dfs_pd = &dev->dfs_pd; | 178 | struct mt76x02_dfs_pattern_detector *dfs_pd = &dev->dfs_pd; |
178 | struct mt76x2_dfs_sequence *seq; | 179 | struct mt76x02_dfs_sequence *seq; |
179 | 180 | ||
180 | if (list_empty(&dfs_pd->seq_pool)) { | 181 | if (list_empty(&dfs_pd->seq_pool)) { |
181 | seq = devm_kzalloc(dev->mt76.dev, sizeof(*seq), GFP_ATOMIC); | 182 | seq = devm_kzalloc(dev->mt76.dev, sizeof(*seq), GFP_ATOMIC); |
182 | } else { | 183 | } else { |
183 | seq = list_first_entry(&dfs_pd->seq_pool, | 184 | seq = list_first_entry(&dfs_pd->seq_pool, |
184 | struct mt76x2_dfs_sequence, | 185 | struct mt76x02_dfs_sequence, |
185 | head); | 186 | head); |
186 | list_del(&seq->head); | 187 | list_del(&seq->head); |
187 | dfs_pd->seq_stats.seq_pool_len--; | 188 | dfs_pd->seq_stats.seq_pool_len--; |
@@ -214,10 +215,10 @@ static int mt76x2_dfs_get_multiple(int val, int frac, int margin) | |||
214 | return factor; | 215 | return factor; |
215 | } | 216 | } |
216 | 217 | ||
217 | static void mt76x2_dfs_detector_reset(struct mt76x2_dev *dev) | 218 | static void mt76x2_dfs_detector_reset(struct mt76x02_dev *dev) |
218 | { | 219 | { |
219 | struct mt76x2_dfs_pattern_detector *dfs_pd = &dev->dfs_pd; | 220 | struct mt76x02_dfs_pattern_detector *dfs_pd = &dev->dfs_pd; |
220 | struct mt76x2_dfs_sequence *seq, *tmp_seq; | 221 | struct mt76x02_dfs_sequence *seq, *tmp_seq; |
221 | int i; | 222 | int i; |
222 | 223 | ||
223 | /* reset hw detector */ | 224 | /* reset hw detector */ |
@@ -235,11 +236,11 @@ static void mt76x2_dfs_detector_reset(struct mt76x2_dev *dev) | |||
235 | } | 236 | } |
236 | } | 237 | } |
237 | 238 | ||
238 | static bool mt76x2_dfs_check_chirp(struct mt76x2_dev *dev) | 239 | static bool mt76x2_dfs_check_chirp(struct mt76x02_dev *dev) |
239 | { | 240 | { |
240 | bool ret = false; | 241 | bool ret = false; |
241 | u32 current_ts, delta_ts; | 242 | u32 current_ts, delta_ts; |
242 | struct mt76x2_dfs_pattern_detector *dfs_pd = &dev->dfs_pd; | 243 | struct mt76x02_dfs_pattern_detector *dfs_pd = &dev->dfs_pd; |
243 | 244 | ||
244 | current_ts = mt76_rr(dev, MT_PBF_LIFE_TIMER); | 245 | current_ts = mt76_rr(dev, MT_PBF_LIFE_TIMER); |
245 | delta_ts = current_ts - dfs_pd->chirp_pulse_ts; | 246 | delta_ts = current_ts - dfs_pd->chirp_pulse_ts; |
@@ -256,8 +257,8 @@ static bool mt76x2_dfs_check_chirp(struct mt76x2_dev *dev) | |||
256 | return ret; | 257 | return ret; |
257 | } | 258 | } |
258 | 259 | ||
259 | static void mt76x2_dfs_get_hw_pulse(struct mt76x2_dev *dev, | 260 | static void mt76x2_dfs_get_hw_pulse(struct mt76x02_dev *dev, |
260 | struct mt76x2_dfs_hw_pulse *pulse) | 261 | struct mt76x02_dfs_hw_pulse *pulse) |
261 | { | 262 | { |
262 | u32 data; | 263 | u32 data; |
263 | 264 | ||
@@ -276,8 +277,8 @@ static void mt76x2_dfs_get_hw_pulse(struct mt76x2_dev *dev, | |||
276 | pulse->burst = mt76_rr(dev, MT_BBP(DFS, 22)); | 277 | pulse->burst = mt76_rr(dev, MT_BBP(DFS, 22)); |
277 | } | 278 | } |
278 | 279 | ||
279 | static bool mt76x2_dfs_check_hw_pulse(struct mt76x2_dev *dev, | 280 | static bool mt76x2_dfs_check_hw_pulse(struct mt76x02_dev *dev, |
280 | struct mt76x2_dfs_hw_pulse *pulse) | 281 | struct mt76x02_dfs_hw_pulse *pulse) |
281 | { | 282 | { |
282 | bool ret = false; | 283 | bool ret = false; |
283 | 284 | ||
@@ -371,8 +372,8 @@ static bool mt76x2_dfs_check_hw_pulse(struct mt76x2_dev *dev, | |||
371 | return ret; | 372 | return ret; |
372 | } | 373 | } |
373 | 374 | ||
374 | static bool mt76x2_dfs_fetch_event(struct mt76x2_dev *dev, | 375 | static bool mt76x2_dfs_fetch_event(struct mt76x02_dev *dev, |
375 | struct mt76x2_dfs_event *event) | 376 | struct mt76x02_dfs_event *event) |
376 | { | 377 | { |
377 | u32 data; | 378 | u32 data; |
378 | 379 | ||
@@ -398,12 +399,12 @@ static bool mt76x2_dfs_fetch_event(struct mt76x2_dev *dev, | |||
398 | return true; | 399 | return true; |
399 | } | 400 | } |
400 | 401 | ||
401 | static bool mt76x2_dfs_check_event(struct mt76x2_dev *dev, | 402 | static bool mt76x2_dfs_check_event(struct mt76x02_dev *dev, |
402 | struct mt76x2_dfs_event *event) | 403 | struct mt76x02_dfs_event *event) |
403 | { | 404 | { |
404 | if (event->engine == 2) { | 405 | if (event->engine == 2) { |
405 | struct mt76x2_dfs_pattern_detector *dfs_pd = &dev->dfs_pd; | 406 | struct mt76x02_dfs_pattern_detector *dfs_pd = &dev->dfs_pd; |
406 | struct mt76x2_dfs_event_rb *event_buff = &dfs_pd->event_rb[1]; | 407 | struct mt76x02_dfs_event_rb *event_buff = &dfs_pd->event_rb[1]; |
407 | u16 last_event_idx; | 408 | u16 last_event_idx; |
408 | u32 delta_ts; | 409 | u32 delta_ts; |
409 | 410 | ||
@@ -417,11 +418,11 @@ static bool mt76x2_dfs_check_event(struct mt76x2_dev *dev, | |||
417 | return true; | 418 | return true; |
418 | } | 419 | } |
419 | 420 | ||
420 | static void mt76x2_dfs_queue_event(struct mt76x2_dev *dev, | 421 | static void mt76x2_dfs_queue_event(struct mt76x02_dev *dev, |
421 | struct mt76x2_dfs_event *event) | 422 | struct mt76x02_dfs_event *event) |
422 | { | 423 | { |
423 | struct mt76x2_dfs_pattern_detector *dfs_pd = &dev->dfs_pd; | 424 | struct mt76x02_dfs_pattern_detector *dfs_pd = &dev->dfs_pd; |
424 | struct mt76x2_dfs_event_rb *event_buff; | 425 | struct mt76x02_dfs_event_rb *event_buff; |
425 | 426 | ||
426 | /* add radar event to ring buffer */ | 427 | /* add radar event to ring buffer */ |
427 | event_buff = event->engine == 2 ? &dfs_pd->event_rb[1] | 428 | event_buff = event->engine == 2 ? &dfs_pd->event_rb[1] |
@@ -435,16 +436,16 @@ static void mt76x2_dfs_queue_event(struct mt76x2_dev *dev, | |||
435 | MT_DFS_EVENT_BUFLEN); | 436 | MT_DFS_EVENT_BUFLEN); |
436 | } | 437 | } |
437 | 438 | ||
438 | static int mt76x2_dfs_create_sequence(struct mt76x2_dev *dev, | 439 | static int mt76x2_dfs_create_sequence(struct mt76x02_dev *dev, |
439 | struct mt76x2_dfs_event *event, | 440 | struct mt76x02_dfs_event *event, |
440 | u16 cur_len) | 441 | u16 cur_len) |
441 | { | 442 | { |
442 | struct mt76x2_dfs_pattern_detector *dfs_pd = &dev->dfs_pd; | 443 | struct mt76x02_dfs_pattern_detector *dfs_pd = &dev->dfs_pd; |
443 | struct mt76x2_dfs_sw_detector_params *sw_params; | 444 | struct mt76x02_dfs_sw_detector_params *sw_params; |
444 | u32 width_delta, with_sum, factor, cur_pri; | 445 | u32 width_delta, with_sum, factor, cur_pri; |
445 | struct mt76x2_dfs_sequence seq, *seq_p; | 446 | struct mt76x02_dfs_sequence seq, *seq_p; |
446 | struct mt76x2_dfs_event_rb *event_rb; | 447 | struct mt76x02_dfs_event_rb *event_rb; |
447 | struct mt76x2_dfs_event *cur_event; | 448 | struct mt76x02_dfs_event *cur_event; |
448 | int i, j, end, pri; | 449 | int i, j, end, pri; |
449 | 450 | ||
450 | event_rb = event->engine == 2 ? &dfs_pd->event_rb[1] | 451 | event_rb = event->engine == 2 ? &dfs_pd->event_rb[1] |
@@ -522,12 +523,12 @@ next: | |||
522 | return 0; | 523 | return 0; |
523 | } | 524 | } |
524 | 525 | ||
525 | static u16 mt76x2_dfs_add_event_to_sequence(struct mt76x2_dev *dev, | 526 | static u16 mt76x2_dfs_add_event_to_sequence(struct mt76x02_dev *dev, |
526 | struct mt76x2_dfs_event *event) | 527 | struct mt76x02_dfs_event *event) |
527 | { | 528 | { |
528 | struct mt76x2_dfs_pattern_detector *dfs_pd = &dev->dfs_pd; | 529 | struct mt76x02_dfs_pattern_detector *dfs_pd = &dev->dfs_pd; |
529 | struct mt76x2_dfs_sw_detector_params *sw_params; | 530 | struct mt76x02_dfs_sw_detector_params *sw_params; |
530 | struct mt76x2_dfs_sequence *seq, *tmp_seq; | 531 | struct mt76x02_dfs_sequence *seq, *tmp_seq; |
531 | u16 max_seq_len = 0; | 532 | u16 max_seq_len = 0; |
532 | u32 factor, pri; | 533 | u32 factor, pri; |
533 | 534 | ||
@@ -554,10 +555,10 @@ static u16 mt76x2_dfs_add_event_to_sequence(struct mt76x2_dev *dev, | |||
554 | return max_seq_len; | 555 | return max_seq_len; |
555 | } | 556 | } |
556 | 557 | ||
557 | static bool mt76x2_dfs_check_detection(struct mt76x2_dev *dev) | 558 | static bool mt76x2_dfs_check_detection(struct mt76x02_dev *dev) |
558 | { | 559 | { |
559 | struct mt76x2_dfs_pattern_detector *dfs_pd = &dev->dfs_pd; | 560 | struct mt76x02_dfs_pattern_detector *dfs_pd = &dev->dfs_pd; |
560 | struct mt76x2_dfs_sequence *seq; | 561 | struct mt76x02_dfs_sequence *seq; |
561 | 562 | ||
562 | if (list_empty(&dfs_pd->sequences)) | 563 | if (list_empty(&dfs_pd->sequences)) |
563 | return false; | 564 | return false; |
@@ -571,10 +572,10 @@ static bool mt76x2_dfs_check_detection(struct mt76x2_dev *dev) | |||
571 | return false; | 572 | return false; |
572 | } | 573 | } |
573 | 574 | ||
574 | static void mt76x2_dfs_add_events(struct mt76x2_dev *dev) | 575 | static void mt76x2_dfs_add_events(struct mt76x02_dev *dev) |
575 | { | 576 | { |
576 | struct mt76x2_dfs_pattern_detector *dfs_pd = &dev->dfs_pd; | 577 | struct mt76x02_dfs_pattern_detector *dfs_pd = &dev->dfs_pd; |
577 | struct mt76x2_dfs_event event; | 578 | struct mt76x02_dfs_event event; |
578 | int i, seq_len; | 579 | int i, seq_len; |
579 | 580 | ||
580 | /* disable debug mode */ | 581 | /* disable debug mode */ |
@@ -598,11 +599,11 @@ static void mt76x2_dfs_add_events(struct mt76x2_dev *dev) | |||
598 | mt76x2_dfs_set_capture_mode_ctrl(dev, true); | 599 | mt76x2_dfs_set_capture_mode_ctrl(dev, true); |
599 | } | 600 | } |
600 | 601 | ||
601 | static void mt76x2_dfs_check_event_window(struct mt76x2_dev *dev) | 602 | static void mt76x2_dfs_check_event_window(struct mt76x02_dev *dev) |
602 | { | 603 | { |
603 | struct mt76x2_dfs_pattern_detector *dfs_pd = &dev->dfs_pd; | 604 | struct mt76x02_dfs_pattern_detector *dfs_pd = &dev->dfs_pd; |
604 | struct mt76x2_dfs_event_rb *event_buff; | 605 | struct mt76x02_dfs_event_rb *event_buff; |
605 | struct mt76x2_dfs_event *event; | 606 | struct mt76x02_dfs_event *event; |
606 | int i; | 607 | int i; |
607 | 608 | ||
608 | for (i = 0; i < ARRAY_SIZE(dfs_pd->event_rb); i++) { | 609 | for (i = 0; i < ARRAY_SIZE(dfs_pd->event_rb); i++) { |
@@ -623,8 +624,8 @@ static void mt76x2_dfs_check_event_window(struct mt76x2_dev *dev) | |||
623 | 624 | ||
624 | static void mt76x2_dfs_tasklet(unsigned long arg) | 625 | static void mt76x2_dfs_tasklet(unsigned long arg) |
625 | { | 626 | { |
626 | struct mt76x2_dev *dev = (struct mt76x2_dev *)arg; | 627 | struct mt76x02_dev *dev = (struct mt76x02_dev *)arg; |
627 | struct mt76x2_dfs_pattern_detector *dfs_pd = &dev->dfs_pd; | 628 | struct mt76x02_dfs_pattern_detector *dfs_pd = &dev->dfs_pd; |
628 | u32 engine_mask; | 629 | u32 engine_mask; |
629 | int i; | 630 | int i; |
630 | 631 | ||
@@ -654,7 +655,7 @@ static void mt76x2_dfs_tasklet(unsigned long arg) | |||
654 | goto out; | 655 | goto out; |
655 | 656 | ||
656 | for (i = 0; i < MT_DFS_NUM_ENGINES; i++) { | 657 | for (i = 0; i < MT_DFS_NUM_ENGINES; i++) { |
657 | struct mt76x2_dfs_hw_pulse pulse; | 658 | struct mt76x02_dfs_hw_pulse pulse; |
658 | 659 | ||
659 | if (!(engine_mask & (1 << i))) | 660 | if (!(engine_mask & (1 << i))) |
660 | continue; | 661 | continue; |
@@ -682,9 +683,9 @@ out: | |||
682 | mt76x02_irq_enable(&dev->mt76, MT_INT_GPTIMER); | 683 | mt76x02_irq_enable(&dev->mt76, MT_INT_GPTIMER); |
683 | } | 684 | } |
684 | 685 | ||
685 | static void mt76x2_dfs_init_sw_detector(struct mt76x2_dev *dev) | 686 | static void mt76x2_dfs_init_sw_detector(struct mt76x02_dev *dev) |
686 | { | 687 | { |
687 | struct mt76x2_dfs_pattern_detector *dfs_pd = &dev->dfs_pd; | 688 | struct mt76x02_dfs_pattern_detector *dfs_pd = &dev->dfs_pd; |
688 | 689 | ||
689 | switch (dev->dfs_pd.region) { | 690 | switch (dev->dfs_pd.region) { |
690 | case NL80211_DFS_FCC: | 691 | case NL80211_DFS_FCC: |
@@ -708,11 +709,11 @@ static void mt76x2_dfs_init_sw_detector(struct mt76x2_dev *dev) | |||
708 | } | 709 | } |
709 | } | 710 | } |
710 | 711 | ||
711 | static void mt76x2_dfs_set_bbp_params(struct mt76x2_dev *dev) | 712 | static void mt76x2_dfs_set_bbp_params(struct mt76x02_dev *dev) |
712 | { | 713 | { |
713 | u32 data; | 714 | const struct mt76x02_radar_specs *radar_specs; |
714 | u8 i, shift; | 715 | u8 i, shift; |
715 | const struct mt76x2_radar_specs *radar_specs; | 716 | u32 data; |
716 | 717 | ||
717 | switch (dev->mt76.chandef.width) { | 718 | switch (dev->mt76.chandef.width) { |
718 | case NL80211_CHAN_WIDTH_40: | 719 | case NL80211_CHAN_WIDTH_40: |
@@ -803,7 +804,7 @@ static void mt76x2_dfs_set_bbp_params(struct mt76x2_dev *dev) | |||
803 | mt76_wr(dev, 0x212c, 0x0c350001); | 804 | mt76_wr(dev, 0x212c, 0x0c350001); |
804 | } | 805 | } |
805 | 806 | ||
806 | void mt76x2_dfs_adjust_agc(struct mt76x2_dev *dev) | 807 | void mt76x2_dfs_adjust_agc(struct mt76x02_dev *dev) |
807 | { | 808 | { |
808 | u32 agc_r8, agc_r4, val_r8, val_r4, dfs_r31; | 809 | u32 agc_r8, agc_r4, val_r8, val_r4, dfs_r31; |
809 | 810 | ||
@@ -824,7 +825,7 @@ void mt76x2_dfs_adjust_agc(struct mt76x2_dev *dev) | |||
824 | mt76_wr(dev, MT_BBP(DFS, 32), 0x00040071); | 825 | mt76_wr(dev, MT_BBP(DFS, 32), 0x00040071); |
825 | } | 826 | } |
826 | 827 | ||
827 | void mt76x2_dfs_init_params(struct mt76x2_dev *dev) | 828 | void mt76x2_dfs_init_params(struct mt76x02_dev *dev) |
828 | { | 829 | { |
829 | struct cfg80211_chan_def *chandef = &dev->mt76.chandef; | 830 | struct cfg80211_chan_def *chandef = &dev->mt76.chandef; |
830 | 831 | ||
@@ -851,9 +852,9 @@ void mt76x2_dfs_init_params(struct mt76x2_dev *dev) | |||
851 | } | 852 | } |
852 | } | 853 | } |
853 | 854 | ||
854 | void mt76x2_dfs_init_detector(struct mt76x2_dev *dev) | 855 | void mt76x2_dfs_init_detector(struct mt76x02_dev *dev) |
855 | { | 856 | { |
856 | struct mt76x2_dfs_pattern_detector *dfs_pd = &dev->dfs_pd; | 857 | struct mt76x02_dfs_pattern_detector *dfs_pd = &dev->dfs_pd; |
857 | 858 | ||
858 | INIT_LIST_HEAD(&dfs_pd->sequences); | 859 | INIT_LIST_HEAD(&dfs_pd->sequences); |
859 | INIT_LIST_HEAD(&dfs_pd->seq_pool); | 860 | INIT_LIST_HEAD(&dfs_pd->seq_pool); |
@@ -863,10 +864,10 @@ void mt76x2_dfs_init_detector(struct mt76x2_dev *dev) | |||
863 | (unsigned long)dev); | 864 | (unsigned long)dev); |
864 | } | 865 | } |
865 | 866 | ||
866 | void mt76x2_dfs_set_domain(struct mt76x2_dev *dev, | 867 | void mt76x2_dfs_set_domain(struct mt76x02_dev *dev, |
867 | enum nl80211_dfs_regions region) | 868 | enum nl80211_dfs_regions region) |
868 | { | 869 | { |
869 | struct mt76x2_dfs_pattern_detector *dfs_pd = &dev->dfs_pd; | 870 | struct mt76x02_dfs_pattern_detector *dfs_pd = &dev->dfs_pd; |
870 | 871 | ||
871 | if (dfs_pd->region != region) { | 872 | if (dfs_pd->region != region) { |
872 | tasklet_disable(&dfs_pd->dfs_tasklet); | 873 | tasklet_disable(&dfs_pd->dfs_tasklet); |
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/pci_dma.c b/drivers/net/wireless/mediatek/mt76/mt76x2/pci_dma.c index fdd5103e8c93..35f0ceb7094b 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2/pci_dma.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x2/pci_dma.c | |||
@@ -20,7 +20,7 @@ | |||
20 | 20 | ||
21 | void mt76x2_tx_tasklet(unsigned long data) | 21 | void mt76x2_tx_tasklet(unsigned long data) |
22 | { | 22 | { |
23 | struct mt76x2_dev *dev = (struct mt76x2_dev *) data; | 23 | struct mt76x02_dev *dev = (struct mt76x02_dev *) data; |
24 | int i; | 24 | int i; |
25 | 25 | ||
26 | mt76x2_mac_process_tx_status_fifo(dev); | 26 | mt76x2_mac_process_tx_status_fifo(dev); |
@@ -32,7 +32,7 @@ void mt76x2_tx_tasklet(unsigned long data) | |||
32 | mt76x02_irq_enable(&dev->mt76, MT_INT_TX_DONE_ALL); | 32 | mt76x02_irq_enable(&dev->mt76, MT_INT_TX_DONE_ALL); |
33 | } | 33 | } |
34 | 34 | ||
35 | void mt76x2_dma_cleanup(struct mt76x2_dev *dev) | 35 | void mt76x2_dma_cleanup(struct mt76x02_dev *dev) |
36 | { | 36 | { |
37 | tasklet_kill(&dev->tx_tasklet); | 37 | tasklet_kill(&dev->tx_tasklet); |
38 | mt76_dma_cleanup(&dev->mt76); | 38 | mt76_dma_cleanup(&dev->mt76); |
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/pci_init.c b/drivers/net/wireless/mediatek/mt76/mt76x2/pci_init.c index a6c66bf08ded..2b38f97c3103 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2/pci_init.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x2/pci_init.c | |||
@@ -22,7 +22,7 @@ | |||
22 | #include "../mt76x02_dma.h" | 22 | #include "../mt76x02_dma.h" |
23 | 23 | ||
24 | static void | 24 | static void |
25 | mt76x2_mac_pbf_init(struct mt76x2_dev *dev) | 25 | mt76x2_mac_pbf_init(struct mt76x02_dev *dev) |
26 | { | 26 | { |
27 | u32 val; | 27 | u32 val; |
28 | 28 | ||
@@ -40,7 +40,7 @@ mt76x2_mac_pbf_init(struct mt76x2_dev *dev) | |||
40 | } | 40 | } |
41 | 41 | ||
42 | static void | 42 | static void |
43 | mt76x2_fixup_xtal(struct mt76x2_dev *dev) | 43 | mt76x2_fixup_xtal(struct mt76x02_dev *dev) |
44 | { | 44 | { |
45 | u16 eep_val; | 45 | u16 eep_val; |
46 | s8 offset = 0; | 46 | s8 offset = 0; |
@@ -79,7 +79,7 @@ mt76x2_fixup_xtal(struct mt76x2_dev *dev) | |||
79 | } | 79 | } |
80 | } | 80 | } |
81 | 81 | ||
82 | static int mt76x2_mac_reset(struct mt76x2_dev *dev, bool hard) | 82 | static int mt76x2_mac_reset(struct mt76x02_dev *dev, bool hard) |
83 | { | 83 | { |
84 | static const u8 null_addr[ETH_ALEN] = {}; | 84 | static const u8 null_addr[ETH_ALEN] = {}; |
85 | const u8 *macaddr = dev->mt76.macaddr; | 85 | const u8 *macaddr = dev->mt76.macaddr; |
@@ -177,7 +177,7 @@ static int mt76x2_mac_reset(struct mt76x2_dev *dev, bool hard) | |||
177 | return 0; | 177 | return 0; |
178 | } | 178 | } |
179 | 179 | ||
180 | int mt76x2_mac_start(struct mt76x2_dev *dev) | 180 | int mt76x2_mac_start(struct mt76x02_dev *dev) |
181 | { | 181 | { |
182 | int i; | 182 | int i; |
183 | 183 | ||
@@ -193,7 +193,7 @@ int mt76x2_mac_start(struct mt76x2_dev *dev) | |||
193 | return 0; | 193 | return 0; |
194 | } | 194 | } |
195 | 195 | ||
196 | void mt76x2_mac_resume(struct mt76x2_dev *dev) | 196 | void mt76x2_mac_resume(struct mt76x02_dev *dev) |
197 | { | 197 | { |
198 | mt76_wr(dev, MT_MAC_SYS_CTRL, | 198 | mt76_wr(dev, MT_MAC_SYS_CTRL, |
199 | MT_MAC_SYS_CTRL_ENABLE_TX | | 199 | MT_MAC_SYS_CTRL_ENABLE_TX | |
@@ -201,7 +201,7 @@ void mt76x2_mac_resume(struct mt76x2_dev *dev) | |||
201 | } | 201 | } |
202 | 202 | ||
203 | static void | 203 | static void |
204 | mt76x2_power_on_rf_patch(struct mt76x2_dev *dev) | 204 | mt76x2_power_on_rf_patch(struct mt76x02_dev *dev) |
205 | { | 205 | { |
206 | mt76_set(dev, 0x10130, BIT(0) | BIT(16)); | 206 | mt76_set(dev, 0x10130, BIT(0) | BIT(16)); |
207 | udelay(1); | 207 | udelay(1); |
@@ -222,7 +222,7 @@ mt76x2_power_on_rf_patch(struct mt76x2_dev *dev) | |||
222 | } | 222 | } |
223 | 223 | ||
224 | static void | 224 | static void |
225 | mt76x2_power_on_rf(struct mt76x2_dev *dev, int unit) | 225 | mt76x2_power_on_rf(struct mt76x02_dev *dev, int unit) |
226 | { | 226 | { |
227 | int shift = unit ? 8 : 0; | 227 | int shift = unit ? 8 : 0; |
228 | 228 | ||
@@ -244,7 +244,7 @@ mt76x2_power_on_rf(struct mt76x2_dev *dev, int unit) | |||
244 | } | 244 | } |
245 | 245 | ||
246 | static void | 246 | static void |
247 | mt76x2_power_on(struct mt76x2_dev *dev) | 247 | mt76x2_power_on(struct mt76x02_dev *dev) |
248 | { | 248 | { |
249 | u32 val; | 249 | u32 val; |
250 | 250 | ||
@@ -279,7 +279,7 @@ mt76x2_power_on(struct mt76x2_dev *dev) | |||
279 | mt76x2_power_on_rf(dev, 1); | 279 | mt76x2_power_on_rf(dev, 1); |
280 | } | 280 | } |
281 | 281 | ||
282 | void mt76x2_set_tx_ackto(struct mt76x2_dev *dev) | 282 | void mt76x2_set_tx_ackto(struct mt76x02_dev *dev) |
283 | { | 283 | { |
284 | u8 ackto, sifs, slottime = dev->slottime; | 284 | u8 ackto, sifs, slottime = dev->slottime; |
285 | 285 | ||
@@ -296,7 +296,7 @@ void mt76x2_set_tx_ackto(struct mt76x2_dev *dev) | |||
296 | MT_TX_TIMEOUT_CFG_ACKTO, ackto); | 296 | MT_TX_TIMEOUT_CFG_ACKTO, ackto); |
297 | } | 297 | } |
298 | 298 | ||
299 | int mt76x2_init_hardware(struct mt76x2_dev *dev) | 299 | int mt76x2_init_hardware(struct mt76x02_dev *dev) |
300 | { | 300 | { |
301 | int ret; | 301 | int ret; |
302 | 302 | ||
@@ -335,7 +335,7 @@ int mt76x2_init_hardware(struct mt76x2_dev *dev) | |||
335 | return 0; | 335 | return 0; |
336 | } | 336 | } |
337 | 337 | ||
338 | void mt76x2_stop_hardware(struct mt76x2_dev *dev) | 338 | void mt76x2_stop_hardware(struct mt76x02_dev *dev) |
339 | { | 339 | { |
340 | cancel_delayed_work_sync(&dev->cal_work); | 340 | cancel_delayed_work_sync(&dev->cal_work); |
341 | cancel_delayed_work_sync(&dev->mac_work); | 341 | cancel_delayed_work_sync(&dev->mac_work); |
@@ -343,7 +343,7 @@ void mt76x2_stop_hardware(struct mt76x2_dev *dev) | |||
343 | mt76x2_mac_stop(dev, false); | 343 | mt76x2_mac_stop(dev, false); |
344 | } | 344 | } |
345 | 345 | ||
346 | void mt76x2_cleanup(struct mt76x2_dev *dev) | 346 | void mt76x2_cleanup(struct mt76x02_dev *dev) |
347 | { | 347 | { |
348 | tasklet_disable(&dev->dfs_pd.dfs_tasklet); | 348 | tasklet_disable(&dev->dfs_pd.dfs_tasklet); |
349 | tasklet_disable(&dev->pre_tbtt_tasklet); | 349 | tasklet_disable(&dev->pre_tbtt_tasklet); |
@@ -352,7 +352,7 @@ void mt76x2_cleanup(struct mt76x2_dev *dev) | |||
352 | mt76x02_mcu_cleanup(&dev->mt76); | 352 | mt76x02_mcu_cleanup(&dev->mt76); |
353 | } | 353 | } |
354 | 354 | ||
355 | struct mt76x2_dev *mt76x2_alloc_device(struct device *pdev) | 355 | struct mt76x02_dev *mt76x2_alloc_device(struct device *pdev) |
356 | { | 356 | { |
357 | static const struct mt76_driver_ops drv_ops = { | 357 | static const struct mt76_driver_ops drv_ops = { |
358 | .txwi_size = sizeof(struct mt76x02_txwi), | 358 | .txwi_size = sizeof(struct mt76x02_txwi), |
@@ -364,14 +364,14 @@ struct mt76x2_dev *mt76x2_alloc_device(struct device *pdev) | |||
364 | .sta_ps = mt76x2_sta_ps, | 364 | .sta_ps = mt76x2_sta_ps, |
365 | .get_tx_txpwr_adj = mt76x2_tx_get_txpwr_adj, | 365 | .get_tx_txpwr_adj = mt76x2_tx_get_txpwr_adj, |
366 | }; | 366 | }; |
367 | struct mt76x2_dev *dev; | 367 | struct mt76x02_dev *dev; |
368 | struct mt76_dev *mdev; | 368 | struct mt76_dev *mdev; |
369 | 369 | ||
370 | mdev = mt76_alloc_device(sizeof(*dev), &mt76x2_ops); | 370 | mdev = mt76_alloc_device(sizeof(*dev), &mt76x2_ops); |
371 | if (!mdev) | 371 | if (!mdev) |
372 | return NULL; | 372 | return NULL; |
373 | 373 | ||
374 | dev = container_of(mdev, struct mt76x2_dev, mt76); | 374 | dev = container_of(mdev, struct mt76x02_dev, mt76); |
375 | mdev->dev = pdev; | 375 | mdev->dev = pdev; |
376 | mdev->drv = &drv_ops; | 376 | mdev->drv = &drv_ops; |
377 | 377 | ||
@@ -382,7 +382,7 @@ static void mt76x2_regd_notifier(struct wiphy *wiphy, | |||
382 | struct regulatory_request *request) | 382 | struct regulatory_request *request) |
383 | { | 383 | { |
384 | struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy); | 384 | struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy); |
385 | struct mt76x2_dev *dev = hw->priv; | 385 | struct mt76x02_dev *dev = hw->priv; |
386 | 386 | ||
387 | mt76x2_dfs_set_domain(dev, request->dfs_region); | 387 | mt76x2_dfs_set_domain(dev, request->dfs_region); |
388 | } | 388 | } |
@@ -418,8 +418,8 @@ static const struct ieee80211_iface_combination if_comb[] = { | |||
418 | static void mt76x2_led_set_config(struct mt76_dev *mt76, u8 delay_on, | 418 | static void mt76x2_led_set_config(struct mt76_dev *mt76, u8 delay_on, |
419 | u8 delay_off) | 419 | u8 delay_off) |
420 | { | 420 | { |
421 | struct mt76x2_dev *dev = container_of(mt76, struct mt76x2_dev, | 421 | struct mt76x02_dev *dev = container_of(mt76, struct mt76x02_dev, |
422 | mt76); | 422 | mt76); |
423 | u32 val; | 423 | u32 val; |
424 | 424 | ||
425 | val = MT_LED_STATUS_DURATION(0xff) | | 425 | val = MT_LED_STATUS_DURATION(0xff) | |
@@ -463,7 +463,7 @@ static void mt76x2_led_set_brightness(struct led_classdev *led_cdev, | |||
463 | mt76x2_led_set_config(mt76, 0xff, 0); | 463 | mt76x2_led_set_config(mt76, 0xff, 0); |
464 | } | 464 | } |
465 | 465 | ||
466 | int mt76x2_register_device(struct mt76x2_dev *dev) | 466 | int mt76x2_register_device(struct mt76x02_dev *dev) |
467 | { | 467 | { |
468 | struct ieee80211_hw *hw = mt76_hw(dev); | 468 | struct ieee80211_hw *hw = mt76_hw(dev); |
469 | struct wiphy *wiphy = hw->wiphy; | 469 | struct wiphy *wiphy = hw->wiphy; |
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/pci_mac.c b/drivers/net/wireless/mediatek/mt76/mt76x2/pci_mac.c index 8037bfb51555..4538afc7e50e 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2/pci_mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x2/pci_mac.c | |||
@@ -21,7 +21,7 @@ | |||
21 | #include "trace.h" | 21 | #include "trace.h" |
22 | #include "../mt76x02_util.h" | 22 | #include "../mt76x02_util.h" |
23 | 23 | ||
24 | void mt76x2_mac_set_bssid(struct mt76x2_dev *dev, u8 idx, const u8 *addr) | 24 | void mt76x2_mac_set_bssid(struct mt76x02_dev *dev, u8 idx, const u8 *addr) |
25 | { | 25 | { |
26 | idx &= 7; | 26 | idx &= 7; |
27 | mt76_wr(dev, MT_MAC_APC_BSSID_L(idx), get_unaligned_le32(addr)); | 27 | mt76_wr(dev, MT_MAC_APC_BSSID_L(idx), get_unaligned_le32(addr)); |
@@ -29,7 +29,7 @@ void mt76x2_mac_set_bssid(struct mt76x2_dev *dev, u8 idx, const u8 *addr) | |||
29 | get_unaligned_le16(addr + 4)); | 29 | get_unaligned_le16(addr + 4)); |
30 | } | 30 | } |
31 | 31 | ||
32 | void mt76x2_mac_poll_tx_status(struct mt76x2_dev *dev, bool irq) | 32 | void mt76x2_mac_poll_tx_status(struct mt76x02_dev *dev, bool irq) |
33 | { | 33 | { |
34 | struct mt76x02_tx_status stat = {}; | 34 | struct mt76x02_tx_status stat = {}; |
35 | unsigned long flags; | 35 | unsigned long flags; |
@@ -61,7 +61,7 @@ void mt76x2_mac_poll_tx_status(struct mt76x2_dev *dev, bool irq) | |||
61 | } | 61 | } |
62 | 62 | ||
63 | static void | 63 | static void |
64 | mt76x2_mac_queue_txdone(struct mt76x2_dev *dev, struct sk_buff *skb, | 64 | mt76x2_mac_queue_txdone(struct mt76x02_dev *dev, struct sk_buff *skb, |
65 | void *txwi_ptr) | 65 | void *txwi_ptr) |
66 | { | 66 | { |
67 | struct mt76x2_tx_info *txi = mt76x2_skb_tx_info(skb); | 67 | struct mt76x2_tx_info *txi = mt76x2_skb_tx_info(skb); |
@@ -77,7 +77,7 @@ mt76x2_mac_queue_txdone(struct mt76x2_dev *dev, struct sk_buff *skb, | |||
77 | mt76x02_tx_complete(&dev->mt76, skb); | 77 | mt76x02_tx_complete(&dev->mt76, skb); |
78 | } | 78 | } |
79 | 79 | ||
80 | void mt76x2_mac_process_tx_status_fifo(struct mt76x2_dev *dev) | 80 | void mt76x2_mac_process_tx_status_fifo(struct mt76x02_dev *dev) |
81 | { | 81 | { |
82 | struct mt76x02_tx_status stat; | 82 | struct mt76x02_tx_status stat; |
83 | u8 update = 1; | 83 | u8 update = 1; |
@@ -89,7 +89,7 @@ void mt76x2_mac_process_tx_status_fifo(struct mt76x2_dev *dev) | |||
89 | void mt76x2_tx_complete_skb(struct mt76_dev *mdev, struct mt76_queue *q, | 89 | void mt76x2_tx_complete_skb(struct mt76_dev *mdev, struct mt76_queue *q, |
90 | struct mt76_queue_entry *e, bool flush) | 90 | struct mt76_queue_entry *e, bool flush) |
91 | { | 91 | { |
92 | struct mt76x2_dev *dev = container_of(mdev, struct mt76x2_dev, mt76); | 92 | struct mt76x02_dev *dev = container_of(mdev, struct mt76x02_dev, mt76); |
93 | 93 | ||
94 | if (e->txwi) | 94 | if (e->txwi) |
95 | mt76x2_mac_queue_txdone(dev, e->skb, &e->txwi->txwi); | 95 | mt76x2_mac_queue_txdone(dev, e->skb, &e->txwi->txwi); |
@@ -98,7 +98,7 @@ void mt76x2_tx_complete_skb(struct mt76_dev *mdev, struct mt76_queue *q, | |||
98 | } | 98 | } |
99 | 99 | ||
100 | static int | 100 | static int |
101 | mt76_write_beacon(struct mt76x2_dev *dev, int offset, struct sk_buff *skb) | 101 | mt76_write_beacon(struct mt76x02_dev *dev, int offset, struct sk_buff *skb) |
102 | { | 102 | { |
103 | int beacon_len = mt76x02_beacon_offsets[1] - mt76x02_beacon_offsets[0]; | 103 | int beacon_len = mt76x02_beacon_offsets[1] - mt76x02_beacon_offsets[0]; |
104 | struct mt76x02_txwi txwi; | 104 | struct mt76x02_txwi txwi; |
@@ -116,7 +116,7 @@ mt76_write_beacon(struct mt76x2_dev *dev, int offset, struct sk_buff *skb) | |||
116 | } | 116 | } |
117 | 117 | ||
118 | static int | 118 | static int |
119 | __mt76x2_mac_set_beacon(struct mt76x2_dev *dev, u8 bcn_idx, struct sk_buff *skb) | 119 | __mt76x2_mac_set_beacon(struct mt76x02_dev *dev, u8 bcn_idx, struct sk_buff *skb) |
120 | { | 120 | { |
121 | int beacon_len = mt76x02_beacon_offsets[1] - mt76x02_beacon_offsets[0]; | 121 | int beacon_len = mt76x02_beacon_offsets[1] - mt76x02_beacon_offsets[0]; |
122 | int beacon_addr = mt76x02_beacon_offsets[bcn_idx]; | 122 | int beacon_addr = mt76x02_beacon_offsets[bcn_idx]; |
@@ -141,7 +141,7 @@ __mt76x2_mac_set_beacon(struct mt76x2_dev *dev, u8 bcn_idx, struct sk_buff *skb) | |||
141 | return ret; | 141 | return ret; |
142 | } | 142 | } |
143 | 143 | ||
144 | int mt76x2_mac_set_beacon(struct mt76x2_dev *dev, u8 vif_idx, | 144 | int mt76x2_mac_set_beacon(struct mt76x02_dev *dev, u8 vif_idx, |
145 | struct sk_buff *skb) | 145 | struct sk_buff *skb) |
146 | { | 146 | { |
147 | bool force_update = false; | 147 | bool force_update = false; |
@@ -176,7 +176,8 @@ int mt76x2_mac_set_beacon(struct mt76x2_dev *dev, u8 vif_idx, | |||
176 | return 0; | 176 | return 0; |
177 | } | 177 | } |
178 | 178 | ||
179 | void mt76x2_mac_set_beacon_enable(struct mt76x2_dev *dev, u8 vif_idx, bool val) | 179 | void mt76x2_mac_set_beacon_enable(struct mt76x02_dev *dev, |
180 | u8 vif_idx, bool val) | ||
180 | { | 181 | { |
181 | u8 old_mask = dev->beacon_mask; | 182 | u8 old_mask = dev->beacon_mask; |
182 | bool en; | 183 | bool en; |
@@ -208,7 +209,7 @@ void mt76x2_mac_set_beacon_enable(struct mt76x2_dev *dev, u8 vif_idx, bool val) | |||
208 | 209 | ||
209 | void mt76x2_update_channel(struct mt76_dev *mdev) | 210 | void mt76x2_update_channel(struct mt76_dev *mdev) |
210 | { | 211 | { |
211 | struct mt76x2_dev *dev = container_of(mdev, struct mt76x2_dev, mt76); | 212 | struct mt76x02_dev *dev = container_of(mdev, struct mt76x02_dev, mt76); |
212 | struct mt76_channel_state *state; | 213 | struct mt76_channel_state *state; |
213 | u32 active, busy; | 214 | u32 active, busy; |
214 | 215 | ||
@@ -225,8 +226,8 @@ void mt76x2_update_channel(struct mt76_dev *mdev) | |||
225 | 226 | ||
226 | void mt76x2_mac_work(struct work_struct *work) | 227 | void mt76x2_mac_work(struct work_struct *work) |
227 | { | 228 | { |
228 | struct mt76x2_dev *dev = container_of(work, struct mt76x2_dev, | 229 | struct mt76x02_dev *dev = container_of(work, struct mt76x02_dev, |
229 | mac_work.work); | 230 | mac_work.work); |
230 | int i, idx; | 231 | int i, idx; |
231 | 232 | ||
232 | mt76x2_update_channel(&dev->mt76); | 233 | mt76x2_update_channel(&dev->mt76); |
@@ -241,7 +242,7 @@ void mt76x2_mac_work(struct work_struct *work) | |||
241 | MT_CALIBRATE_INTERVAL); | 242 | MT_CALIBRATE_INTERVAL); |
242 | } | 243 | } |
243 | 244 | ||
244 | void mt76x2_mac_set_tx_protection(struct mt76x2_dev *dev, u32 val) | 245 | void mt76x2_mac_set_tx_protection(struct mt76x02_dev *dev, u32 val) |
245 | { | 246 | { |
246 | u32 data = 0; | 247 | u32 data = 0; |
247 | 248 | ||
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/pci_main.c b/drivers/net/wireless/mediatek/mt76/mt76x2/pci_main.c index 521c9265bfe0..2556c65c6528 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2/pci_main.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x2/pci_main.c | |||
@@ -20,7 +20,7 @@ | |||
20 | static int | 20 | static int |
21 | mt76x2_start(struct ieee80211_hw *hw) | 21 | mt76x2_start(struct ieee80211_hw *hw) |
22 | { | 22 | { |
23 | struct mt76x2_dev *dev = hw->priv; | 23 | struct mt76x02_dev *dev = hw->priv; |
24 | int ret; | 24 | int ret; |
25 | 25 | ||
26 | mutex_lock(&dev->mt76.mutex); | 26 | mutex_lock(&dev->mt76.mutex); |
@@ -46,7 +46,7 @@ out: | |||
46 | static void | 46 | static void |
47 | mt76x2_stop(struct ieee80211_hw *hw) | 47 | mt76x2_stop(struct ieee80211_hw *hw) |
48 | { | 48 | { |
49 | struct mt76x2_dev *dev = hw->priv; | 49 | struct mt76x02_dev *dev = hw->priv; |
50 | 50 | ||
51 | mutex_lock(&dev->mt76.mutex); | 51 | mutex_lock(&dev->mt76.mutex); |
52 | clear_bit(MT76_STATE_RUNNING, &dev->mt76.state); | 52 | clear_bit(MT76_STATE_RUNNING, &dev->mt76.state); |
@@ -55,7 +55,7 @@ mt76x2_stop(struct ieee80211_hw *hw) | |||
55 | } | 55 | } |
56 | 56 | ||
57 | static int | 57 | static int |
58 | mt76x2_set_channel(struct mt76x2_dev *dev, struct cfg80211_chan_def *chandef) | 58 | mt76x2_set_channel(struct mt76x02_dev *dev, struct cfg80211_chan_def *chandef) |
59 | { | 59 | { |
60 | int ret; | 60 | int ret; |
61 | 61 | ||
@@ -91,7 +91,7 @@ mt76x2_set_channel(struct mt76x2_dev *dev, struct cfg80211_chan_def *chandef) | |||
91 | static int | 91 | static int |
92 | mt76x2_config(struct ieee80211_hw *hw, u32 changed) | 92 | mt76x2_config(struct ieee80211_hw *hw, u32 changed) |
93 | { | 93 | { |
94 | struct mt76x2_dev *dev = hw->priv; | 94 | struct mt76x02_dev *dev = hw->priv; |
95 | int ret = 0; | 95 | int ret = 0; |
96 | 96 | ||
97 | mutex_lock(&dev->mt76.mutex); | 97 | mutex_lock(&dev->mt76.mutex); |
@@ -132,7 +132,7 @@ static void | |||
132 | mt76x2_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | 132 | mt76x2_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
133 | struct ieee80211_bss_conf *info, u32 changed) | 133 | struct ieee80211_bss_conf *info, u32 changed) |
134 | { | 134 | { |
135 | struct mt76x2_dev *dev = hw->priv; | 135 | struct mt76x02_dev *dev = hw->priv; |
136 | struct mt76x02_vif *mvif = (struct mt76x02_vif *) vif->drv_priv; | 136 | struct mt76x02_vif *mvif = (struct mt76x02_vif *) vif->drv_priv; |
137 | 137 | ||
138 | mutex_lock(&dev->mt76.mutex); | 138 | mutex_lock(&dev->mt76.mutex); |
@@ -169,7 +169,7 @@ void | |||
169 | mt76x2_sta_ps(struct mt76_dev *mdev, struct ieee80211_sta *sta, bool ps) | 169 | mt76x2_sta_ps(struct mt76_dev *mdev, struct ieee80211_sta *sta, bool ps) |
170 | { | 170 | { |
171 | struct mt76x02_sta *msta = (struct mt76x02_sta *) sta->drv_priv; | 171 | struct mt76x02_sta *msta = (struct mt76x02_sta *) sta->drv_priv; |
172 | struct mt76x2_dev *dev = container_of(mdev, struct mt76x2_dev, mt76); | 172 | struct mt76x02_dev *dev = container_of(mdev, struct mt76x02_dev, mt76); |
173 | int idx = msta->wcid.idx; | 173 | int idx = msta->wcid.idx; |
174 | 174 | ||
175 | mt76_stop_tx_queues(&dev->mt76, sta, true); | 175 | mt76_stop_tx_queues(&dev->mt76, sta, true); |
@@ -180,7 +180,7 @@ static void | |||
180 | mt76x2_sw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | 180 | mt76x2_sw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
181 | const u8 *mac) | 181 | const u8 *mac) |
182 | { | 182 | { |
183 | struct mt76x2_dev *dev = hw->priv; | 183 | struct mt76x02_dev *dev = hw->priv; |
184 | 184 | ||
185 | tasklet_disable(&dev->pre_tbtt_tasklet); | 185 | tasklet_disable(&dev->pre_tbtt_tasklet); |
186 | set_bit(MT76_SCANNING, &dev->mt76.state); | 186 | set_bit(MT76_SCANNING, &dev->mt76.state); |
@@ -189,7 +189,7 @@ mt76x2_sw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
189 | static void | 189 | static void |
190 | mt76x2_sw_scan_complete(struct ieee80211_hw *hw, struct ieee80211_vif *vif) | 190 | mt76x2_sw_scan_complete(struct ieee80211_hw *hw, struct ieee80211_vif *vif) |
191 | { | 191 | { |
192 | struct mt76x2_dev *dev = hw->priv; | 192 | struct mt76x02_dev *dev = hw->priv; |
193 | 193 | ||
194 | clear_bit(MT76_SCANNING, &dev->mt76.state); | 194 | clear_bit(MT76_SCANNING, &dev->mt76.state); |
195 | tasklet_enable(&dev->pre_tbtt_tasklet); | 195 | tasklet_enable(&dev->pre_tbtt_tasklet); |
@@ -204,7 +204,7 @@ mt76x2_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
204 | static int | 204 | static int |
205 | mt76x2_get_txpower(struct ieee80211_hw *hw, struct ieee80211_vif *vif, int *dbm) | 205 | mt76x2_get_txpower(struct ieee80211_hw *hw, struct ieee80211_vif *vif, int *dbm) |
206 | { | 206 | { |
207 | struct mt76x2_dev *dev = hw->priv; | 207 | struct mt76x02_dev *dev = hw->priv; |
208 | 208 | ||
209 | *dbm = dev->mt76.txpower_cur / 2; | 209 | *dbm = dev->mt76.txpower_cur / 2; |
210 | 210 | ||
@@ -217,7 +217,7 @@ mt76x2_get_txpower(struct ieee80211_hw *hw, struct ieee80211_vif *vif, int *dbm) | |||
217 | static void mt76x2_set_coverage_class(struct ieee80211_hw *hw, | 217 | static void mt76x2_set_coverage_class(struct ieee80211_hw *hw, |
218 | s16 coverage_class) | 218 | s16 coverage_class) |
219 | { | 219 | { |
220 | struct mt76x2_dev *dev = hw->priv; | 220 | struct mt76x02_dev *dev = hw->priv; |
221 | 221 | ||
222 | mutex_lock(&dev->mt76.mutex); | 222 | mutex_lock(&dev->mt76.mutex); |
223 | dev->coverage_class = coverage_class; | 223 | dev->coverage_class = coverage_class; |
@@ -234,7 +234,7 @@ mt76x2_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta, bool set) | |||
234 | static int mt76x2_set_antenna(struct ieee80211_hw *hw, u32 tx_ant, | 234 | static int mt76x2_set_antenna(struct ieee80211_hw *hw, u32 tx_ant, |
235 | u32 rx_ant) | 235 | u32 rx_ant) |
236 | { | 236 | { |
237 | struct mt76x2_dev *dev = hw->priv; | 237 | struct mt76x02_dev *dev = hw->priv; |
238 | 238 | ||
239 | if (!tx_ant || tx_ant > 3 || tx_ant != rx_ant) | 239 | if (!tx_ant || tx_ant > 3 || tx_ant != rx_ant) |
240 | return -EINVAL; | 240 | return -EINVAL; |
@@ -255,7 +255,7 @@ static int mt76x2_set_antenna(struct ieee80211_hw *hw, u32 tx_ant, | |||
255 | static int mt76x2_get_antenna(struct ieee80211_hw *hw, u32 *tx_ant, | 255 | static int mt76x2_get_antenna(struct ieee80211_hw *hw, u32 *tx_ant, |
256 | u32 *rx_ant) | 256 | u32 *rx_ant) |
257 | { | 257 | { |
258 | struct mt76x2_dev *dev = hw->priv; | 258 | struct mt76x02_dev *dev = hw->priv; |
259 | 259 | ||
260 | mutex_lock(&dev->mt76.mutex); | 260 | mutex_lock(&dev->mt76.mutex); |
261 | *tx_ant = dev->mt76.antenna_mask; | 261 | *tx_ant = dev->mt76.antenna_mask; |
@@ -268,7 +268,7 @@ static int mt76x2_get_antenna(struct ieee80211_hw *hw, u32 *tx_ant, | |||
268 | static int | 268 | static int |
269 | mt76x2_set_rts_threshold(struct ieee80211_hw *hw, u32 val) | 269 | mt76x2_set_rts_threshold(struct ieee80211_hw *hw, u32 val) |
270 | { | 270 | { |
271 | struct mt76x2_dev *dev = hw->priv; | 271 | struct mt76x02_dev *dev = hw->priv; |
272 | 272 | ||
273 | if (val != ~0 && val > 0xffff) | 273 | if (val != ~0 && val > 0xffff) |
274 | return -EINVAL; | 274 | return -EINVAL; |
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/pci_mcu.c b/drivers/net/wireless/mediatek/mt76/mt76x2/pci_mcu.c index 38fa84bddf7b..a17c9a5279ad 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2/pci_mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x2/pci_mcu.c | |||
@@ -24,7 +24,7 @@ | |||
24 | #include "../mt76x02_dma.h" | 24 | #include "../mt76x02_dma.h" |
25 | 25 | ||
26 | static int | 26 | static int |
27 | mt76pci_load_rom_patch(struct mt76x2_dev *dev) | 27 | mt76pci_load_rom_patch(struct mt76x02_dev *dev) |
28 | { | 28 | { |
29 | const struct firmware *fw = NULL; | 29 | const struct firmware *fw = NULL; |
30 | struct mt76x02_patch_header *hdr; | 30 | struct mt76x02_patch_header *hdr; |
@@ -90,7 +90,7 @@ out: | |||
90 | } | 90 | } |
91 | 91 | ||
92 | static int | 92 | static int |
93 | mt76pci_load_firmware(struct mt76x2_dev *dev) | 93 | mt76pci_load_firmware(struct mt76x02_dev *dev) |
94 | { | 94 | { |
95 | const struct firmware *fw; | 95 | const struct firmware *fw; |
96 | const struct mt76x02_fw_header *hdr; | 96 | const struct mt76x02_fw_header *hdr; |
@@ -166,7 +166,7 @@ error: | |||
166 | return -ENOENT; | 166 | return -ENOENT; |
167 | } | 167 | } |
168 | 168 | ||
169 | int mt76x2_mcu_init(struct mt76x2_dev *dev) | 169 | int mt76x2_mcu_init(struct mt76x02_dev *dev) |
170 | { | 170 | { |
171 | static const struct mt76_mcu_ops mt76x2_mcu_ops = { | 171 | static const struct mt76_mcu_ops mt76x2_mcu_ops = { |
172 | .mcu_msg_alloc = mt76x02_mcu_msg_alloc, | 172 | .mcu_msg_alloc = mt76x02_mcu_msg_alloc, |
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/pci_phy.c b/drivers/net/wireless/mediatek/mt76/mt76x2/pci_phy.c index 2ac0cc6c7126..40ea5f7480fb 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2/pci_phy.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x2/pci_phy.c | |||
@@ -21,7 +21,7 @@ | |||
21 | #include "../mt76x02_phy.h" | 21 | #include "../mt76x02_phy.h" |
22 | 22 | ||
23 | static bool | 23 | static bool |
24 | mt76x2_phy_tssi_init_cal(struct mt76x2_dev *dev) | 24 | mt76x2_phy_tssi_init_cal(struct mt76x02_dev *dev) |
25 | { | 25 | { |
26 | struct ieee80211_channel *chan = dev->mt76.chandef.chan; | 26 | struct ieee80211_channel *chan = dev->mt76.chandef.chan; |
27 | u32 flag = 0; | 27 | u32 flag = 0; |
@@ -44,7 +44,7 @@ mt76x2_phy_tssi_init_cal(struct mt76x2_dev *dev) | |||
44 | } | 44 | } |
45 | 45 | ||
46 | static void | 46 | static void |
47 | mt76x2_phy_channel_calibrate(struct mt76x2_dev *dev, bool mac_stopped) | 47 | mt76x2_phy_channel_calibrate(struct mt76x02_dev *dev, bool mac_stopped) |
48 | { | 48 | { |
49 | struct ieee80211_channel *chan = dev->mt76.chandef.chan; | 49 | struct ieee80211_channel *chan = dev->mt76.chandef.chan; |
50 | bool is_5ghz = chan->band == NL80211_BAND_5GHZ; | 50 | bool is_5ghz = chan->band == NL80211_BAND_5GHZ; |
@@ -78,7 +78,7 @@ mt76x2_phy_channel_calibrate(struct mt76x2_dev *dev, bool mac_stopped) | |||
78 | dev->cal.channel_cal_done = true; | 78 | dev->cal.channel_cal_done = true; |
79 | } | 79 | } |
80 | 80 | ||
81 | void mt76x2_phy_set_antenna(struct mt76x2_dev *dev) | 81 | void mt76x2_phy_set_antenna(struct mt76x02_dev *dev) |
82 | { | 82 | { |
83 | u32 val; | 83 | u32 val; |
84 | 84 | ||
@@ -125,14 +125,14 @@ void mt76x2_phy_set_antenna(struct mt76x2_dev *dev) | |||
125 | } | 125 | } |
126 | 126 | ||
127 | static void | 127 | static void |
128 | mt76x2_get_agc_gain(struct mt76x2_dev *dev, u8 *dest) | 128 | mt76x2_get_agc_gain(struct mt76x02_dev *dev, u8 *dest) |
129 | { | 129 | { |
130 | dest[0] = mt76_get_field(dev, MT_BBP(AGC, 8), MT_BBP_AGC_GAIN); | 130 | dest[0] = mt76_get_field(dev, MT_BBP(AGC, 8), MT_BBP_AGC_GAIN); |
131 | dest[1] = mt76_get_field(dev, MT_BBP(AGC, 9), MT_BBP_AGC_GAIN); | 131 | dest[1] = mt76_get_field(dev, MT_BBP(AGC, 9), MT_BBP_AGC_GAIN); |
132 | } | 132 | } |
133 | 133 | ||
134 | static int | 134 | static int |
135 | mt76x2_get_rssi_gain_thresh(struct mt76x2_dev *dev) | 135 | mt76x2_get_rssi_gain_thresh(struct mt76x02_dev *dev) |
136 | { | 136 | { |
137 | switch (dev->mt76.chandef.width) { | 137 | switch (dev->mt76.chandef.width) { |
138 | case NL80211_CHAN_WIDTH_80: | 138 | case NL80211_CHAN_WIDTH_80: |
@@ -145,7 +145,7 @@ mt76x2_get_rssi_gain_thresh(struct mt76x2_dev *dev) | |||
145 | } | 145 | } |
146 | 146 | ||
147 | static int | 147 | static int |
148 | mt76x2_get_low_rssi_gain_thresh(struct mt76x2_dev *dev) | 148 | mt76x2_get_low_rssi_gain_thresh(struct mt76x02_dev *dev) |
149 | { | 149 | { |
150 | switch (dev->mt76.chandef.width) { | 150 | switch (dev->mt76.chandef.width) { |
151 | case NL80211_CHAN_WIDTH_80: | 151 | case NL80211_CHAN_WIDTH_80: |
@@ -158,7 +158,7 @@ mt76x2_get_low_rssi_gain_thresh(struct mt76x2_dev *dev) | |||
158 | } | 158 | } |
159 | 159 | ||
160 | static void | 160 | static void |
161 | mt76x2_phy_set_gain_val(struct mt76x2_dev *dev) | 161 | mt76x2_phy_set_gain_val(struct mt76x02_dev *dev) |
162 | { | 162 | { |
163 | u32 val; | 163 | u32 val; |
164 | u8 gain_val[2]; | 164 | u8 gain_val[2]; |
@@ -183,7 +183,7 @@ mt76x2_phy_set_gain_val(struct mt76x2_dev *dev) | |||
183 | } | 183 | } |
184 | 184 | ||
185 | static void | 185 | static void |
186 | mt76x2_phy_adjust_vga_gain(struct mt76x2_dev *dev) | 186 | mt76x2_phy_adjust_vga_gain(struct mt76x02_dev *dev) |
187 | { | 187 | { |
188 | u32 false_cca; | 188 | u32 false_cca; |
189 | u8 limit = dev->cal.low_gain > 0 ? 16 : 4; | 189 | u8 limit = dev->cal.low_gain > 0 ? 16 : 4; |
@@ -202,7 +202,7 @@ mt76x2_phy_adjust_vga_gain(struct mt76x2_dev *dev) | |||
202 | } | 202 | } |
203 | 203 | ||
204 | static void | 204 | static void |
205 | mt76x2_phy_update_channel_gain(struct mt76x2_dev *dev) | 205 | mt76x2_phy_update_channel_gain(struct mt76x02_dev *dev) |
206 | { | 206 | { |
207 | u8 *gain = dev->cal.agc_gain_init; | 207 | u8 *gain = dev->cal.agc_gain_init; |
208 | u8 low_gain_delta, gain_delta; | 208 | u8 low_gain_delta, gain_delta; |
@@ -265,7 +265,7 @@ mt76x2_phy_update_channel_gain(struct mt76x2_dev *dev) | |||
265 | mt76_rr(dev, MT_RX_STAT_1); | 265 | mt76_rr(dev, MT_RX_STAT_1); |
266 | } | 266 | } |
267 | 267 | ||
268 | int mt76x2_phy_set_channel(struct mt76x2_dev *dev, | 268 | int mt76x2_phy_set_channel(struct mt76x02_dev *dev, |
269 | struct cfg80211_chan_def *chandef) | 269 | struct cfg80211_chan_def *chandef) |
270 | { | 270 | { |
271 | struct ieee80211_channel *chan = chandef->chan; | 271 | struct ieee80211_channel *chan = chandef->chan; |
@@ -405,7 +405,7 @@ int mt76x2_phy_set_channel(struct mt76x2_dev *dev, | |||
405 | } | 405 | } |
406 | 406 | ||
407 | static void | 407 | static void |
408 | mt76x2_phy_temp_compensate(struct mt76x2_dev *dev) | 408 | mt76x2_phy_temp_compensate(struct mt76x02_dev *dev) |
409 | { | 409 | { |
410 | struct mt76x2_temp_comp t; | 410 | struct mt76x2_temp_comp t; |
411 | int temp, db_diff; | 411 | int temp, db_diff; |
@@ -434,9 +434,9 @@ mt76x2_phy_temp_compensate(struct mt76x2_dev *dev) | |||
434 | 434 | ||
435 | void mt76x2_phy_calibrate(struct work_struct *work) | 435 | void mt76x2_phy_calibrate(struct work_struct *work) |
436 | { | 436 | { |
437 | struct mt76x2_dev *dev; | 437 | struct mt76x02_dev *dev; |
438 | 438 | ||
439 | dev = container_of(work, struct mt76x2_dev, cal_work.work); | 439 | dev = container_of(work, struct mt76x02_dev, cal_work.work); |
440 | mt76x2_phy_channel_calibrate(dev, false); | 440 | mt76x2_phy_channel_calibrate(dev, false); |
441 | mt76x2_phy_tssi_compensate(dev, true); | 441 | mt76x2_phy_tssi_compensate(dev, true); |
442 | mt76x2_phy_temp_compensate(dev); | 442 | mt76x2_phy_temp_compensate(dev); |
@@ -445,7 +445,7 @@ void mt76x2_phy_calibrate(struct work_struct *work) | |||
445 | MT_CALIBRATE_INTERVAL); | 445 | MT_CALIBRATE_INTERVAL); |
446 | } | 446 | } |
447 | 447 | ||
448 | int mt76x2_phy_start(struct mt76x2_dev *dev) | 448 | int mt76x2_phy_start(struct mt76x02_dev *dev) |
449 | { | 449 | { |
450 | int ret; | 450 | int ret; |
451 | 451 | ||
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/pci_tx.c b/drivers/net/wireless/mediatek/mt76/mt76x2/pci_tx.c index bef28d57bfcc..ab9cb632222c 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2/pci_tx.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x2/pci_tx.c | |||
@@ -19,7 +19,7 @@ | |||
19 | #include "../mt76x02_dma.h" | 19 | #include "../mt76x02_dma.h" |
20 | 20 | ||
21 | struct beacon_bc_data { | 21 | struct beacon_bc_data { |
22 | struct mt76x2_dev *dev; | 22 | struct mt76x02_dev *dev; |
23 | struct sk_buff_head q; | 23 | struct sk_buff_head q; |
24 | struct sk_buff *tail[8]; | 24 | struct sk_buff *tail[8]; |
25 | }; | 25 | }; |
@@ -29,7 +29,7 @@ int mt76x2_tx_prepare_skb(struct mt76_dev *mdev, void *txwi, | |||
29 | struct mt76_wcid *wcid, struct ieee80211_sta *sta, | 29 | struct mt76_wcid *wcid, struct ieee80211_sta *sta, |
30 | u32 *tx_info) | 30 | u32 *tx_info) |
31 | { | 31 | { |
32 | struct mt76x2_dev *dev = container_of(mdev, struct mt76x2_dev, mt76); | 32 | struct mt76x02_dev *dev = container_of(mdev, struct mt76x02_dev, mt76); |
33 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | 33 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); |
34 | int qsel = MT_QSEL_EDCA; | 34 | int qsel = MT_QSEL_EDCA; |
35 | int ret; | 35 | int ret; |
@@ -58,7 +58,7 @@ int mt76x2_tx_prepare_skb(struct mt76_dev *mdev, void *txwi, | |||
58 | static void | 58 | static void |
59 | mt76x2_update_beacon_iter(void *priv, u8 *mac, struct ieee80211_vif *vif) | 59 | mt76x2_update_beacon_iter(void *priv, u8 *mac, struct ieee80211_vif *vif) |
60 | { | 60 | { |
61 | struct mt76x2_dev *dev = (struct mt76x2_dev *) priv; | 61 | struct mt76x02_dev *dev = (struct mt76x02_dev *) priv; |
62 | struct mt76x02_vif *mvif = (struct mt76x02_vif *) vif->drv_priv; | 62 | struct mt76x02_vif *mvif = (struct mt76x02_vif *) vif->drv_priv; |
63 | struct sk_buff *skb = NULL; | 63 | struct sk_buff *skb = NULL; |
64 | 64 | ||
@@ -76,7 +76,7 @@ static void | |||
76 | mt76x2_add_buffered_bc(void *priv, u8 *mac, struct ieee80211_vif *vif) | 76 | mt76x2_add_buffered_bc(void *priv, u8 *mac, struct ieee80211_vif *vif) |
77 | { | 77 | { |
78 | struct beacon_bc_data *data = priv; | 78 | struct beacon_bc_data *data = priv; |
79 | struct mt76x2_dev *dev = data->dev; | 79 | struct mt76x02_dev *dev = data->dev; |
80 | struct mt76x02_vif *mvif = (struct mt76x02_vif *) vif->drv_priv; | 80 | struct mt76x02_vif *mvif = (struct mt76x02_vif *) vif->drv_priv; |
81 | struct ieee80211_tx_info *info; | 81 | struct ieee80211_tx_info *info; |
82 | struct sk_buff *skb; | 82 | struct sk_buff *skb; |
@@ -97,7 +97,7 @@ mt76x2_add_buffered_bc(void *priv, u8 *mac, struct ieee80211_vif *vif) | |||
97 | } | 97 | } |
98 | 98 | ||
99 | static void | 99 | static void |
100 | mt76x2_resync_beacon_timer(struct mt76x2_dev *dev) | 100 | mt76x2_resync_beacon_timer(struct mt76x02_dev *dev) |
101 | { | 101 | { |
102 | u32 timer_val = dev->beacon_int << 4; | 102 | u32 timer_val = dev->beacon_int << 4; |
103 | 103 | ||
@@ -129,7 +129,7 @@ mt76x2_resync_beacon_timer(struct mt76x2_dev *dev) | |||
129 | 129 | ||
130 | void mt76x2_pre_tbtt_tasklet(unsigned long arg) | 130 | void mt76x2_pre_tbtt_tasklet(unsigned long arg) |
131 | { | 131 | { |
132 | struct mt76x2_dev *dev = (struct mt76x2_dev *) arg; | 132 | struct mt76x02_dev *dev = (struct mt76x02_dev *) arg; |
133 | struct mt76_queue *q = &dev->mt76.q_tx[MT_TXQ_PSD]; | 133 | struct mt76_queue *q = &dev->mt76.q_tx[MT_TXQ_PSD]; |
134 | struct beacon_bc_data data = {}; | 134 | struct beacon_bc_data data = {}; |
135 | struct sk_buff *skb; | 135 | struct sk_buff *skb; |
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/phy.c b/drivers/net/wireless/mediatek/mt76/mt76x2/phy.c index 06ef2c4a5c11..f00aed915ee8 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2/phy.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x2/phy.c | |||
@@ -21,7 +21,7 @@ | |||
21 | #include "../mt76x02_phy.h" | 21 | #include "../mt76x02_phy.h" |
22 | 22 | ||
23 | static void | 23 | static void |
24 | mt76x2_adjust_high_lna_gain(struct mt76x2_dev *dev, int reg, s8 offset) | 24 | mt76x2_adjust_high_lna_gain(struct mt76x02_dev *dev, int reg, s8 offset) |
25 | { | 25 | { |
26 | s8 gain; | 26 | s8 gain; |
27 | 27 | ||
@@ -31,7 +31,7 @@ mt76x2_adjust_high_lna_gain(struct mt76x2_dev *dev, int reg, s8 offset) | |||
31 | } | 31 | } |
32 | 32 | ||
33 | static void | 33 | static void |
34 | mt76x2_adjust_agc_gain(struct mt76x2_dev *dev, int reg, s8 offset) | 34 | mt76x2_adjust_agc_gain(struct mt76x02_dev *dev, int reg, s8 offset) |
35 | { | 35 | { |
36 | s8 gain; | 36 | s8 gain; |
37 | 37 | ||
@@ -40,7 +40,7 @@ mt76x2_adjust_agc_gain(struct mt76x2_dev *dev, int reg, s8 offset) | |||
40 | mt76_rmw_field(dev, MT_BBP(AGC, reg), MT_BBP_AGC_GAIN, gain); | 40 | mt76_rmw_field(dev, MT_BBP(AGC, reg), MT_BBP_AGC_GAIN, gain); |
41 | } | 41 | } |
42 | 42 | ||
43 | void mt76x2_apply_gain_adj(struct mt76x2_dev *dev) | 43 | void mt76x2_apply_gain_adj(struct mt76x02_dev *dev) |
44 | { | 44 | { |
45 | s8 *gain_adj = dev->cal.rx.high_gain; | 45 | s8 *gain_adj = dev->cal.rx.high_gain; |
46 | 46 | ||
@@ -52,7 +52,7 @@ void mt76x2_apply_gain_adj(struct mt76x2_dev *dev) | |||
52 | } | 52 | } |
53 | EXPORT_SYMBOL_GPL(mt76x2_apply_gain_adj); | 53 | EXPORT_SYMBOL_GPL(mt76x2_apply_gain_adj); |
54 | 54 | ||
55 | void mt76x2_phy_set_txpower_regs(struct mt76x2_dev *dev, | 55 | void mt76x2_phy_set_txpower_regs(struct mt76x02_dev *dev, |
56 | enum nl80211_band band) | 56 | enum nl80211_band band) |
57 | { | 57 | { |
58 | u32 pa_mode[2]; | 58 | u32 pa_mode[2]; |
@@ -144,7 +144,7 @@ mt76x2_get_min_rate_power(struct mt76_rate_power *r) | |||
144 | return ret; | 144 | return ret; |
145 | } | 145 | } |
146 | 146 | ||
147 | void mt76x2_phy_set_txpower(struct mt76x2_dev *dev) | 147 | void mt76x2_phy_set_txpower(struct mt76x02_dev *dev) |
148 | { | 148 | { |
149 | enum nl80211_chan_width width = dev->mt76.chandef.width; | 149 | enum nl80211_chan_width width = dev->mt76.chandef.width; |
150 | struct ieee80211_channel *chan = dev->mt76.chandef.chan; | 150 | struct ieee80211_channel *chan = dev->mt76.chandef.chan; |
@@ -191,7 +191,7 @@ void mt76x2_phy_set_txpower(struct mt76x2_dev *dev) | |||
191 | } | 191 | } |
192 | EXPORT_SYMBOL_GPL(mt76x2_phy_set_txpower); | 192 | EXPORT_SYMBOL_GPL(mt76x2_phy_set_txpower); |
193 | 193 | ||
194 | void mt76x2_configure_tx_delay(struct mt76x2_dev *dev, | 194 | void mt76x2_configure_tx_delay(struct mt76x02_dev *dev, |
195 | enum nl80211_band band, u8 bw) | 195 | enum nl80211_band band, u8 bw) |
196 | { | 196 | { |
197 | u32 cfg0, cfg1; | 197 | u32 cfg0, cfg1; |
@@ -210,7 +210,7 @@ void mt76x2_configure_tx_delay(struct mt76x2_dev *dev, | |||
210 | } | 210 | } |
211 | EXPORT_SYMBOL_GPL(mt76x2_configure_tx_delay); | 211 | EXPORT_SYMBOL_GPL(mt76x2_configure_tx_delay); |
212 | 212 | ||
213 | void mt76x2_phy_set_bw(struct mt76x2_dev *dev, int width, u8 ctrl) | 213 | void mt76x2_phy_set_bw(struct mt76x02_dev *dev, int width, u8 ctrl) |
214 | { | 214 | { |
215 | int core_val, agc_val; | 215 | int core_val, agc_val; |
216 | 216 | ||
@@ -236,7 +236,7 @@ void mt76x2_phy_set_bw(struct mt76x2_dev *dev, int width, u8 ctrl) | |||
236 | } | 236 | } |
237 | EXPORT_SYMBOL_GPL(mt76x2_phy_set_bw); | 237 | EXPORT_SYMBOL_GPL(mt76x2_phy_set_bw); |
238 | 238 | ||
239 | void mt76x2_phy_set_band(struct mt76x2_dev *dev, int band, bool primary_upper) | 239 | void mt76x2_phy_set_band(struct mt76x02_dev *dev, int band, bool primary_upper) |
240 | { | 240 | { |
241 | switch (band) { | 241 | switch (band) { |
242 | case NL80211_BAND_2GHZ: | 242 | case NL80211_BAND_2GHZ: |
@@ -254,7 +254,7 @@ void mt76x2_phy_set_band(struct mt76x2_dev *dev, int band, bool primary_upper) | |||
254 | } | 254 | } |
255 | EXPORT_SYMBOL_GPL(mt76x2_phy_set_band); | 255 | EXPORT_SYMBOL_GPL(mt76x2_phy_set_band); |
256 | 256 | ||
257 | void mt76x2_phy_tssi_compensate(struct mt76x2_dev *dev, bool wait) | 257 | void mt76x2_phy_tssi_compensate(struct mt76x02_dev *dev, bool wait) |
258 | { | 258 | { |
259 | struct ieee80211_channel *chan = dev->mt76.chandef.chan; | 259 | struct ieee80211_channel *chan = dev->mt76.chandef.chan; |
260 | struct mt76x2_tx_power_info txp; | 260 | struct mt76x2_tx_power_info txp; |
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/trace.h b/drivers/net/wireless/mediatek/mt76/mt76x2/trace.h index 9dceabace936..ef88623fa6c9 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2/trace.h +++ b/drivers/net/wireless/mediatek/mt76/mt76x2/trace.h | |||
@@ -35,7 +35,7 @@ | |||
35 | #define TXID_PR_ARG __entry->wcid, __entry->pktid | 35 | #define TXID_PR_ARG __entry->wcid, __entry->pktid |
36 | 36 | ||
37 | DECLARE_EVENT_CLASS(dev_evt, | 37 | DECLARE_EVENT_CLASS(dev_evt, |
38 | TP_PROTO(struct mt76x2_dev *dev), | 38 | TP_PROTO(struct mt76x02_dev *dev), |
39 | TP_ARGS(dev), | 39 | TP_ARGS(dev), |
40 | TP_STRUCT__entry( | 40 | TP_STRUCT__entry( |
41 | DEV_ENTRY | 41 | DEV_ENTRY |
@@ -47,7 +47,7 @@ DECLARE_EVENT_CLASS(dev_evt, | |||
47 | ); | 47 | ); |
48 | 48 | ||
49 | DECLARE_EVENT_CLASS(dev_txid_evt, | 49 | DECLARE_EVENT_CLASS(dev_txid_evt, |
50 | TP_PROTO(struct mt76x2_dev *dev, u8 wcid, u8 pktid), | 50 | TP_PROTO(struct mt76x02_dev *dev, u8 wcid, u8 pktid), |
51 | TP_ARGS(dev, wcid, pktid), | 51 | TP_ARGS(dev, wcid, pktid), |
52 | TP_STRUCT__entry( | 52 | TP_STRUCT__entry( |
53 | DEV_ENTRY | 53 | DEV_ENTRY |
@@ -64,17 +64,17 @@ DECLARE_EVENT_CLASS(dev_txid_evt, | |||
64 | ); | 64 | ); |
65 | 65 | ||
66 | DEFINE_EVENT(dev_evt, mac_txstat_poll, | 66 | DEFINE_EVENT(dev_evt, mac_txstat_poll, |
67 | TP_PROTO(struct mt76x2_dev *dev), | 67 | TP_PROTO(struct mt76x02_dev *dev), |
68 | TP_ARGS(dev) | 68 | TP_ARGS(dev) |
69 | ); | 69 | ); |
70 | 70 | ||
71 | DEFINE_EVENT(dev_txid_evt, mac_txdone_add, | 71 | DEFINE_EVENT(dev_txid_evt, mac_txdone_add, |
72 | TP_PROTO(struct mt76x2_dev *dev, u8 wcid, u8 pktid), | 72 | TP_PROTO(struct mt76x02_dev *dev, u8 wcid, u8 pktid), |
73 | TP_ARGS(dev, wcid, pktid) | 73 | TP_ARGS(dev, wcid, pktid) |
74 | ); | 74 | ); |
75 | 75 | ||
76 | TRACE_EVENT(mac_txstat_fetch, | 76 | TRACE_EVENT(mac_txstat_fetch, |
77 | TP_PROTO(struct mt76x2_dev *dev, | 77 | TP_PROTO(struct mt76x02_dev *dev, |
78 | struct mt76x02_tx_status *stat), | 78 | struct mt76x02_tx_status *stat), |
79 | 79 | ||
80 | TP_ARGS(dev, stat), | 80 | TP_ARGS(dev, stat), |
@@ -112,7 +112,7 @@ TRACE_EVENT(mac_txstat_fetch, | |||
112 | 112 | ||
113 | 113 | ||
114 | TRACE_EVENT(dev_irq, | 114 | TRACE_EVENT(dev_irq, |
115 | TP_PROTO(struct mt76x2_dev *dev, u32 val, u32 mask), | 115 | TP_PROTO(struct mt76x02_dev *dev, u32 val, u32 mask), |
116 | 116 | ||
117 | TP_ARGS(dev, val, mask), | 117 | TP_ARGS(dev, val, mask), |
118 | 118 | ||
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/tx.c b/drivers/net/wireless/mediatek/mt76/mt76x2/tx.c index c8203e49560c..144ee6973797 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2/tx.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x2/tx.c | |||
@@ -22,7 +22,7 @@ void mt76x2_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control, | |||
22 | struct sk_buff *skb) | 22 | struct sk_buff *skb) |
23 | { | 23 | { |
24 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | 24 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); |
25 | struct mt76x2_dev *dev = hw->priv; | 25 | struct mt76x02_dev *dev = hw->priv; |
26 | struct ieee80211_vif *vif = info->control.vif; | 26 | struct ieee80211_vif *vif = info->control.vif; |
27 | struct mt76_wcid *wcid = &dev->mt76.global_wcid; | 27 | struct mt76_wcid *wcid = &dev->mt76.global_wcid; |
28 | 28 | ||
@@ -49,7 +49,7 @@ EXPORT_SYMBOL_GPL(mt76x2_tx); | |||
49 | 49 | ||
50 | s8 mt76x2_tx_get_txpwr_adj(struct mt76_dev *mdev, s8 txpwr, s8 max_txpwr_adj) | 50 | s8 mt76x2_tx_get_txpwr_adj(struct mt76_dev *mdev, s8 txpwr, s8 max_txpwr_adj) |
51 | { | 51 | { |
52 | struct mt76x2_dev *dev = container_of(mdev, struct mt76x2_dev, mt76); | 52 | struct mt76x02_dev *dev = container_of(mdev, struct mt76x02_dev, mt76); |
53 | 53 | ||
54 | txpwr = min_t(s8, txpwr, dev->mt76.txpower_conf); | 54 | txpwr = min_t(s8, txpwr, dev->mt76.txpower_conf); |
55 | txpwr -= (dev->target_power + dev->target_power_delta[0]); | 55 | txpwr -= (dev->target_power + dev->target_power_delta[0]); |
@@ -64,7 +64,7 @@ s8 mt76x2_tx_get_txpwr_adj(struct mt76_dev *mdev, s8 txpwr, s8 max_txpwr_adj) | |||
64 | } | 64 | } |
65 | EXPORT_SYMBOL_GPL(mt76x2_tx_get_txpwr_adj); | 65 | EXPORT_SYMBOL_GPL(mt76x2_tx_get_txpwr_adj); |
66 | 66 | ||
67 | void mt76x2_tx_set_txpwr_auto(struct mt76x2_dev *dev, s8 txpwr) | 67 | void mt76x2_tx_set_txpwr_auto(struct mt76x02_dev *dev, s8 txpwr) |
68 | { | 68 | { |
69 | s8 txpwr_adj; | 69 | s8 txpwr_adj; |
70 | 70 | ||
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/usb.c b/drivers/net/wireless/mediatek/mt76/mt76x2/usb.c index b0c172107aae..57baf8d1c830 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2/usb.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x2/usb.c | |||
@@ -37,7 +37,7 @@ static int mt76x2u_probe(struct usb_interface *intf, | |||
37 | const struct usb_device_id *id) | 37 | const struct usb_device_id *id) |
38 | { | 38 | { |
39 | struct usb_device *udev = interface_to_usbdev(intf); | 39 | struct usb_device *udev = interface_to_usbdev(intf); |
40 | struct mt76x2_dev *dev; | 40 | struct mt76x02_dev *dev; |
41 | int err; | 41 | int err; |
42 | 42 | ||
43 | dev = mt76x2u_alloc_device(&intf->dev); | 43 | dev = mt76x2u_alloc_device(&intf->dev); |
@@ -72,7 +72,7 @@ err: | |||
72 | static void mt76x2u_disconnect(struct usb_interface *intf) | 72 | static void mt76x2u_disconnect(struct usb_interface *intf) |
73 | { | 73 | { |
74 | struct usb_device *udev = interface_to_usbdev(intf); | 74 | struct usb_device *udev = interface_to_usbdev(intf); |
75 | struct mt76x2_dev *dev = usb_get_intfdata(intf); | 75 | struct mt76x02_dev *dev = usb_get_intfdata(intf); |
76 | struct ieee80211_hw *hw = mt76_hw(dev); | 76 | struct ieee80211_hw *hw = mt76_hw(dev); |
77 | 77 | ||
78 | set_bit(MT76_REMOVED, &dev->mt76.state); | 78 | set_bit(MT76_REMOVED, &dev->mt76.state); |
@@ -87,7 +87,7 @@ static void mt76x2u_disconnect(struct usb_interface *intf) | |||
87 | static int __maybe_unused mt76x2u_suspend(struct usb_interface *intf, | 87 | static int __maybe_unused mt76x2u_suspend(struct usb_interface *intf, |
88 | pm_message_t state) | 88 | pm_message_t state) |
89 | { | 89 | { |
90 | struct mt76x2_dev *dev = usb_get_intfdata(intf); | 90 | struct mt76x02_dev *dev = usb_get_intfdata(intf); |
91 | struct mt76_usb *usb = &dev->mt76.usb; | 91 | struct mt76_usb *usb = &dev->mt76.usb; |
92 | 92 | ||
93 | mt76u_stop_queues(&dev->mt76); | 93 | mt76u_stop_queues(&dev->mt76); |
@@ -99,7 +99,7 @@ static int __maybe_unused mt76x2u_suspend(struct usb_interface *intf, | |||
99 | 99 | ||
100 | static int __maybe_unused mt76x2u_resume(struct usb_interface *intf) | 100 | static int __maybe_unused mt76x2u_resume(struct usb_interface *intf) |
101 | { | 101 | { |
102 | struct mt76x2_dev *dev = usb_get_intfdata(intf); | 102 | struct mt76x02_dev *dev = usb_get_intfdata(intf); |
103 | struct mt76_usb *usb = &dev->mt76.usb; | 103 | struct mt76_usb *usb = &dev->mt76.usb; |
104 | int err; | 104 | int err; |
105 | 105 | ||
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c b/drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c index 3570d0714f4d..57687df83268 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c | |||
@@ -22,7 +22,7 @@ | |||
22 | #include "eeprom.h" | 22 | #include "eeprom.h" |
23 | #include "../mt76x02_usb.h" | 23 | #include "../mt76x02_usb.h" |
24 | 24 | ||
25 | static void mt76x2u_init_dma(struct mt76x2_dev *dev) | 25 | static void mt76x2u_init_dma(struct mt76x02_dev *dev) |
26 | { | 26 | { |
27 | u32 val = mt76_rr(dev, MT_VEND_ADDR(CFG, MT_USB_U3DMA_CFG)); | 27 | u32 val = mt76_rr(dev, MT_VEND_ADDR(CFG, MT_USB_U3DMA_CFG)); |
28 | 28 | ||
@@ -37,7 +37,7 @@ static void mt76x2u_init_dma(struct mt76x2_dev *dev) | |||
37 | mt76_wr(dev, MT_VEND_ADDR(CFG, MT_USB_U3DMA_CFG), val); | 37 | mt76_wr(dev, MT_VEND_ADDR(CFG, MT_USB_U3DMA_CFG), val); |
38 | } | 38 | } |
39 | 39 | ||
40 | static void mt76x2u_power_on_rf_patch(struct mt76x2_dev *dev) | 40 | static void mt76x2u_power_on_rf_patch(struct mt76x02_dev *dev) |
41 | { | 41 | { |
42 | mt76_set(dev, MT_VEND_ADDR(CFG, 0x130), BIT(0) | BIT(16)); | 42 | mt76_set(dev, MT_VEND_ADDR(CFG, 0x130), BIT(0) | BIT(16)); |
43 | udelay(1); | 43 | udelay(1); |
@@ -57,7 +57,7 @@ static void mt76x2u_power_on_rf_patch(struct mt76x2_dev *dev) | |||
57 | mt76_set(dev, MT_VEND_ADDR(CFG, 0x14c), BIT(19) | BIT(20)); | 57 | mt76_set(dev, MT_VEND_ADDR(CFG, 0x14c), BIT(19) | BIT(20)); |
58 | } | 58 | } |
59 | 59 | ||
60 | static void mt76x2u_power_on_rf(struct mt76x2_dev *dev, int unit) | 60 | static void mt76x2u_power_on_rf(struct mt76x02_dev *dev, int unit) |
61 | { | 61 | { |
62 | int shift = unit ? 8 : 0; | 62 | int shift = unit ? 8 : 0; |
63 | u32 val = (BIT(1) | BIT(3) | BIT(4) | BIT(5)) << shift; | 63 | u32 val = (BIT(1) | BIT(3) | BIT(4) | BIT(5)) << shift; |
@@ -79,7 +79,7 @@ static void mt76x2u_power_on_rf(struct mt76x2_dev *dev, int unit) | |||
79 | mt76_set(dev, 0x530, 0xf); | 79 | mt76_set(dev, 0x530, 0xf); |
80 | } | 80 | } |
81 | 81 | ||
82 | static void mt76x2u_power_on(struct mt76x2_dev *dev) | 82 | static void mt76x2u_power_on(struct mt76x02_dev *dev) |
83 | { | 83 | { |
84 | u32 val; | 84 | u32 val; |
85 | 85 | ||
@@ -115,7 +115,7 @@ static void mt76x2u_power_on(struct mt76x2_dev *dev) | |||
115 | mt76x2u_power_on_rf(dev, 1); | 115 | mt76x2u_power_on_rf(dev, 1); |
116 | } | 116 | } |
117 | 117 | ||
118 | static int mt76x2u_init_eeprom(struct mt76x2_dev *dev) | 118 | static int mt76x2u_init_eeprom(struct mt76x02_dev *dev) |
119 | { | 119 | { |
120 | u32 val, i; | 120 | u32 val, i; |
121 | 121 | ||
@@ -135,7 +135,7 @@ static int mt76x2u_init_eeprom(struct mt76x2_dev *dev) | |||
135 | return 0; | 135 | return 0; |
136 | } | 136 | } |
137 | 137 | ||
138 | struct mt76x2_dev *mt76x2u_alloc_device(struct device *pdev) | 138 | struct mt76x02_dev *mt76x2u_alloc_device(struct device *pdev) |
139 | { | 139 | { |
140 | static const struct mt76_driver_ops drv_ops = { | 140 | static const struct mt76_driver_ops drv_ops = { |
141 | .tx_prepare_skb = mt76x02u_tx_prepare_skb, | 141 | .tx_prepare_skb = mt76x02u_tx_prepare_skb, |
@@ -143,21 +143,21 @@ struct mt76x2_dev *mt76x2u_alloc_device(struct device *pdev) | |||
143 | .tx_status_data = mt76x02_tx_status_data, | 143 | .tx_status_data = mt76x02_tx_status_data, |
144 | .rx_skb = mt76x2_queue_rx_skb, | 144 | .rx_skb = mt76x2_queue_rx_skb, |
145 | }; | 145 | }; |
146 | struct mt76x2_dev *dev; | 146 | struct mt76x02_dev *dev; |
147 | struct mt76_dev *mdev; | 147 | struct mt76_dev *mdev; |
148 | 148 | ||
149 | mdev = mt76_alloc_device(sizeof(*dev), &mt76x2u_ops); | 149 | mdev = mt76_alloc_device(sizeof(*dev), &mt76x2u_ops); |
150 | if (!mdev) | 150 | if (!mdev) |
151 | return NULL; | 151 | return NULL; |
152 | 152 | ||
153 | dev = container_of(mdev, struct mt76x2_dev, mt76); | 153 | dev = container_of(mdev, struct mt76x02_dev, mt76); |
154 | mdev->dev = pdev; | 154 | mdev->dev = pdev; |
155 | mdev->drv = &drv_ops; | 155 | mdev->drv = &drv_ops; |
156 | 156 | ||
157 | return dev; | 157 | return dev; |
158 | } | 158 | } |
159 | 159 | ||
160 | static void mt76x2u_init_beacon_offsets(struct mt76x2_dev *dev) | 160 | static void mt76x2u_init_beacon_offsets(struct mt76x02_dev *dev) |
161 | { | 161 | { |
162 | mt76_wr(dev, MT_BCN_OFFSET(0), 0x18100800); | 162 | mt76_wr(dev, MT_BCN_OFFSET(0), 0x18100800); |
163 | mt76_wr(dev, MT_BCN_OFFSET(1), 0x38302820); | 163 | mt76_wr(dev, MT_BCN_OFFSET(1), 0x38302820); |
@@ -165,7 +165,7 @@ static void mt76x2u_init_beacon_offsets(struct mt76x2_dev *dev) | |||
165 | mt76_wr(dev, MT_BCN_OFFSET(3), 0x78706860); | 165 | mt76_wr(dev, MT_BCN_OFFSET(3), 0x78706860); |
166 | } | 166 | } |
167 | 167 | ||
168 | int mt76x2u_init_hardware(struct mt76x2_dev *dev) | 168 | int mt76x2u_init_hardware(struct mt76x02_dev *dev) |
169 | { | 169 | { |
170 | const struct mt76_wcid_addr addr = { | 170 | const struct mt76_wcid_addr addr = { |
171 | .macaddr = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}, | 171 | .macaddr = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}, |
@@ -244,7 +244,7 @@ int mt76x2u_init_hardware(struct mt76x2_dev *dev) | |||
244 | return mt76x2u_mac_stop(dev); | 244 | return mt76x2u_mac_stop(dev); |
245 | } | 245 | } |
246 | 246 | ||
247 | int mt76x2u_register_device(struct mt76x2_dev *dev) | 247 | int mt76x2u_register_device(struct mt76x02_dev *dev) |
248 | { | 248 | { |
249 | struct ieee80211_hw *hw = mt76_hw(dev); | 249 | struct ieee80211_hw *hw = mt76_hw(dev); |
250 | struct wiphy *wiphy = hw->wiphy; | 250 | struct wiphy *wiphy = hw->wiphy; |
@@ -295,14 +295,14 @@ fail: | |||
295 | return err; | 295 | return err; |
296 | } | 296 | } |
297 | 297 | ||
298 | void mt76x2u_stop_hw(struct mt76x2_dev *dev) | 298 | void mt76x2u_stop_hw(struct mt76x02_dev *dev) |
299 | { | 299 | { |
300 | mt76u_stop_stat_wk(&dev->mt76); | 300 | mt76u_stop_stat_wk(&dev->mt76); |
301 | cancel_delayed_work_sync(&dev->cal_work); | 301 | cancel_delayed_work_sync(&dev->cal_work); |
302 | mt76x2u_mac_stop(dev); | 302 | mt76x2u_mac_stop(dev); |
303 | } | 303 | } |
304 | 304 | ||
305 | void mt76x2u_cleanup(struct mt76x2_dev *dev) | 305 | void mt76x2u_cleanup(struct mt76x02_dev *dev) |
306 | { | 306 | { |
307 | mt76x02_mcu_set_radio_state(&dev->mt76, false, false); | 307 | mt76x02_mcu_set_radio_state(&dev->mt76, false, false); |
308 | mt76x2u_stop_hw(dev); | 308 | mt76x2u_stop_hw(dev); |
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/usb_mac.c b/drivers/net/wireless/mediatek/mt76/mt76x2/usb_mac.c index ae89461f803c..dbd635aa763b 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2/usb_mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x2/usb_mac.c | |||
@@ -17,7 +17,7 @@ | |||
17 | #include "mt76x2u.h" | 17 | #include "mt76x2u.h" |
18 | #include "eeprom.h" | 18 | #include "eeprom.h" |
19 | 19 | ||
20 | static void mt76x2u_mac_reset_counters(struct mt76x2_dev *dev) | 20 | static void mt76x2u_mac_reset_counters(struct mt76x02_dev *dev) |
21 | { | 21 | { |
22 | mt76_rr(dev, MT_RX_STAT_0); | 22 | mt76_rr(dev, MT_RX_STAT_0); |
23 | mt76_rr(dev, MT_RX_STAT_1); | 23 | mt76_rr(dev, MT_RX_STAT_1); |
@@ -27,7 +27,7 @@ static void mt76x2u_mac_reset_counters(struct mt76x2_dev *dev) | |||
27 | mt76_rr(dev, MT_TX_STA_2); | 27 | mt76_rr(dev, MT_TX_STA_2); |
28 | } | 28 | } |
29 | 29 | ||
30 | static void mt76x2u_mac_fixup_xtal(struct mt76x2_dev *dev) | 30 | static void mt76x2u_mac_fixup_xtal(struct mt76x02_dev *dev) |
31 | { | 31 | { |
32 | s8 offset = 0; | 32 | s8 offset = 0; |
33 | u16 eep_val; | 33 | u16 eep_val; |
@@ -80,7 +80,7 @@ static void mt76x2u_mac_fixup_xtal(struct mt76x2_dev *dev) | |||
80 | } | 80 | } |
81 | } | 81 | } |
82 | 82 | ||
83 | int mt76x2u_mac_reset(struct mt76x2_dev *dev) | 83 | int mt76x2u_mac_reset(struct mt76x02_dev *dev) |
84 | { | 84 | { |
85 | mt76_wr(dev, MT_WPDMA_GLO_CFG, BIT(4) | BIT(5)); | 85 | mt76_wr(dev, MT_WPDMA_GLO_CFG, BIT(4) | BIT(5)); |
86 | 86 | ||
@@ -114,7 +114,7 @@ int mt76x2u_mac_reset(struct mt76x2_dev *dev) | |||
114 | return 0; | 114 | return 0; |
115 | } | 115 | } |
116 | 116 | ||
117 | int mt76x2u_mac_start(struct mt76x2_dev *dev) | 117 | int mt76x2u_mac_start(struct mt76x02_dev *dev) |
118 | { | 118 | { |
119 | mt76x2u_mac_reset_counters(dev); | 119 | mt76x2u_mac_reset_counters(dev); |
120 | 120 | ||
@@ -131,7 +131,7 @@ int mt76x2u_mac_start(struct mt76x2_dev *dev) | |||
131 | return 0; | 131 | return 0; |
132 | } | 132 | } |
133 | 133 | ||
134 | int mt76x2u_mac_stop(struct mt76x2_dev *dev) | 134 | int mt76x2u_mac_stop(struct mt76x02_dev *dev) |
135 | { | 135 | { |
136 | int i, count = 0, val; | 136 | int i, count = 0, val; |
137 | bool stopped = false; | 137 | bool stopped = false; |
@@ -212,7 +212,7 @@ int mt76x2u_mac_stop(struct mt76x2_dev *dev) | |||
212 | return 0; | 212 | return 0; |
213 | } | 213 | } |
214 | 214 | ||
215 | void mt76x2u_mac_resume(struct mt76x2_dev *dev) | 215 | void mt76x2u_mac_resume(struct mt76x02_dev *dev) |
216 | { | 216 | { |
217 | mt76_wr(dev, MT_MAC_SYS_CTRL, | 217 | mt76_wr(dev, MT_MAC_SYS_CTRL, |
218 | MT_MAC_SYS_CTRL_ENABLE_TX | | 218 | MT_MAC_SYS_CTRL_ENABLE_TX | |
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/usb_main.c b/drivers/net/wireless/mediatek/mt76/mt76x2/usb_main.c index 26f1c04ea448..6c2f26c6722e 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2/usb_main.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x2/usb_main.c | |||
@@ -19,7 +19,7 @@ | |||
19 | 19 | ||
20 | static int mt76x2u_start(struct ieee80211_hw *hw) | 20 | static int mt76x2u_start(struct ieee80211_hw *hw) |
21 | { | 21 | { |
22 | struct mt76x2_dev *dev = hw->priv; | 22 | struct mt76x02_dev *dev = hw->priv; |
23 | int ret; | 23 | int ret; |
24 | 24 | ||
25 | mutex_lock(&dev->mt76.mutex); | 25 | mutex_lock(&dev->mt76.mutex); |
@@ -37,7 +37,7 @@ out: | |||
37 | 37 | ||
38 | static void mt76x2u_stop(struct ieee80211_hw *hw) | 38 | static void mt76x2u_stop(struct ieee80211_hw *hw) |
39 | { | 39 | { |
40 | struct mt76x2_dev *dev = hw->priv; | 40 | struct mt76x02_dev *dev = hw->priv; |
41 | 41 | ||
42 | mutex_lock(&dev->mt76.mutex); | 42 | mutex_lock(&dev->mt76.mutex); |
43 | clear_bit(MT76_STATE_RUNNING, &dev->mt76.state); | 43 | clear_bit(MT76_STATE_RUNNING, &dev->mt76.state); |
@@ -48,7 +48,7 @@ static void mt76x2u_stop(struct ieee80211_hw *hw) | |||
48 | static int mt76x2u_add_interface(struct ieee80211_hw *hw, | 48 | static int mt76x2u_add_interface(struct ieee80211_hw *hw, |
49 | struct ieee80211_vif *vif) | 49 | struct ieee80211_vif *vif) |
50 | { | 50 | { |
51 | struct mt76x2_dev *dev = hw->priv; | 51 | struct mt76x02_dev *dev = hw->priv; |
52 | 52 | ||
53 | if (!ether_addr_equal(dev->mt76.macaddr, vif->addr)) | 53 | if (!ether_addr_equal(dev->mt76.macaddr, vif->addr)) |
54 | mt76x02_mac_setaddr(&dev->mt76, vif->addr); | 54 | mt76x02_mac_setaddr(&dev->mt76, vif->addr); |
@@ -58,7 +58,7 @@ static int mt76x2u_add_interface(struct ieee80211_hw *hw, | |||
58 | } | 58 | } |
59 | 59 | ||
60 | static int | 60 | static int |
61 | mt76x2u_set_channel(struct mt76x2_dev *dev, | 61 | mt76x2u_set_channel(struct mt76x02_dev *dev, |
62 | struct cfg80211_chan_def *chandef) | 62 | struct cfg80211_chan_def *chandef) |
63 | { | 63 | { |
64 | int err; | 64 | int err; |
@@ -86,7 +86,7 @@ static void | |||
86 | mt76x2u_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | 86 | mt76x2u_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
87 | struct ieee80211_bss_conf *info, u32 changed) | 87 | struct ieee80211_bss_conf *info, u32 changed) |
88 | { | 88 | { |
89 | struct mt76x2_dev *dev = hw->priv; | 89 | struct mt76x02_dev *dev = hw->priv; |
90 | 90 | ||
91 | mutex_lock(&dev->mt76.mutex); | 91 | mutex_lock(&dev->mt76.mutex); |
92 | 92 | ||
@@ -108,7 +108,7 @@ mt76x2u_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
108 | static int | 108 | static int |
109 | mt76x2u_config(struct ieee80211_hw *hw, u32 changed) | 109 | mt76x2u_config(struct ieee80211_hw *hw, u32 changed) |
110 | { | 110 | { |
111 | struct mt76x2_dev *dev = hw->priv; | 111 | struct mt76x02_dev *dev = hw->priv; |
112 | int err = 0; | 112 | int err = 0; |
113 | 113 | ||
114 | mutex_lock(&dev->mt76.mutex); | 114 | mutex_lock(&dev->mt76.mutex); |
@@ -146,7 +146,7 @@ static void | |||
146 | mt76x2u_sw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | 146 | mt76x2u_sw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
147 | const u8 *mac) | 147 | const u8 *mac) |
148 | { | 148 | { |
149 | struct mt76x2_dev *dev = hw->priv; | 149 | struct mt76x02_dev *dev = hw->priv; |
150 | 150 | ||
151 | set_bit(MT76_SCANNING, &dev->mt76.state); | 151 | set_bit(MT76_SCANNING, &dev->mt76.state); |
152 | } | 152 | } |
@@ -154,7 +154,7 @@ mt76x2u_sw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
154 | static void | 154 | static void |
155 | mt76x2u_sw_scan_complete(struct ieee80211_hw *hw, struct ieee80211_vif *vif) | 155 | mt76x2u_sw_scan_complete(struct ieee80211_hw *hw, struct ieee80211_vif *vif) |
156 | { | 156 | { |
157 | struct mt76x2_dev *dev = hw->priv; | 157 | struct mt76x02_dev *dev = hw->priv; |
158 | 158 | ||
159 | clear_bit(MT76_SCANNING, &dev->mt76.state); | 159 | clear_bit(MT76_SCANNING, &dev->mt76.state); |
160 | } | 160 | } |
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/usb_mcu.c b/drivers/net/wireless/mediatek/mt76/mt76x2/usb_mcu.c index 35e157be456c..259ceae2a3a9 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2/usb_mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x2/usb_mcu.c | |||
@@ -29,7 +29,7 @@ | |||
29 | #define MT76U_MCU_DLM_OFFSET 0x110000 | 29 | #define MT76U_MCU_DLM_OFFSET 0x110000 |
30 | #define MT76U_MCU_ROM_PATCH_OFFSET 0x90000 | 30 | #define MT76U_MCU_ROM_PATCH_OFFSET 0x90000 |
31 | 31 | ||
32 | int mt76x2u_mcu_set_dynamic_vga(struct mt76x2_dev *dev, u8 channel, bool ap, | 32 | int mt76x2u_mcu_set_dynamic_vga(struct mt76x02_dev *dev, u8 channel, bool ap, |
33 | bool ext, int rssi, u32 false_cca) | 33 | bool ext, int rssi, u32 false_cca) |
34 | { | 34 | { |
35 | struct { | 35 | struct { |
@@ -53,14 +53,14 @@ int mt76x2u_mcu_set_dynamic_vga(struct mt76x2_dev *dev, u8 channel, bool ap, | |||
53 | return mt76_mcu_send_msg(dev, skb, CMD_DYNC_VGA_OP, true); | 53 | return mt76_mcu_send_msg(dev, skb, CMD_DYNC_VGA_OP, true); |
54 | } | 54 | } |
55 | 55 | ||
56 | static void mt76x2u_mcu_load_ivb(struct mt76x2_dev *dev) | 56 | static void mt76x2u_mcu_load_ivb(struct mt76x02_dev *dev) |
57 | { | 57 | { |
58 | mt76u_vendor_request(&dev->mt76, MT_VEND_DEV_MODE, | 58 | mt76u_vendor_request(&dev->mt76, MT_VEND_DEV_MODE, |
59 | USB_DIR_OUT | USB_TYPE_VENDOR, | 59 | USB_DIR_OUT | USB_TYPE_VENDOR, |
60 | 0x12, 0, NULL, 0); | 60 | 0x12, 0, NULL, 0); |
61 | } | 61 | } |
62 | 62 | ||
63 | static void mt76x2u_mcu_enable_patch(struct mt76x2_dev *dev) | 63 | static void mt76x2u_mcu_enable_patch(struct mt76x02_dev *dev) |
64 | { | 64 | { |
65 | struct mt76_usb *usb = &dev->mt76.usb; | 65 | struct mt76_usb *usb = &dev->mt76.usb; |
66 | const u8 data[] = { | 66 | const u8 data[] = { |
@@ -75,7 +75,7 @@ static void mt76x2u_mcu_enable_patch(struct mt76x2_dev *dev) | |||
75 | 0x12, 0, usb->data, sizeof(data)); | 75 | 0x12, 0, usb->data, sizeof(data)); |
76 | } | 76 | } |
77 | 77 | ||
78 | static void mt76x2u_mcu_reset_wmt(struct mt76x2_dev *dev) | 78 | static void mt76x2u_mcu_reset_wmt(struct mt76x02_dev *dev) |
79 | { | 79 | { |
80 | struct mt76_usb *usb = &dev->mt76.usb; | 80 | struct mt76_usb *usb = &dev->mt76.usb; |
81 | u8 data[] = { | 81 | u8 data[] = { |
@@ -89,7 +89,7 @@ static void mt76x2u_mcu_reset_wmt(struct mt76x2_dev *dev) | |||
89 | 0x12, 0, usb->data, sizeof(data)); | 89 | 0x12, 0, usb->data, sizeof(data)); |
90 | } | 90 | } |
91 | 91 | ||
92 | static int mt76x2u_mcu_load_rom_patch(struct mt76x2_dev *dev) | 92 | static int mt76x2u_mcu_load_rom_patch(struct mt76x02_dev *dev) |
93 | { | 93 | { |
94 | bool rom_protect = !is_mt7612(dev); | 94 | bool rom_protect = !is_mt7612(dev); |
95 | struct mt76x02_patch_header *hdr; | 95 | struct mt76x02_patch_header *hdr; |
@@ -176,7 +176,7 @@ out: | |||
176 | return err; | 176 | return err; |
177 | } | 177 | } |
178 | 178 | ||
179 | static int mt76x2u_mcu_load_firmware(struct mt76x2_dev *dev) | 179 | static int mt76x2u_mcu_load_firmware(struct mt76x02_dev *dev) |
180 | { | 180 | { |
181 | u32 val, dlm_offset = MT76U_MCU_DLM_OFFSET; | 181 | u32 val, dlm_offset = MT76U_MCU_DLM_OFFSET; |
182 | const struct mt76x02_fw_header *hdr; | 182 | const struct mt76x02_fw_header *hdr; |
@@ -268,7 +268,7 @@ out: | |||
268 | return err; | 268 | return err; |
269 | } | 269 | } |
270 | 270 | ||
271 | int mt76x2u_mcu_fw_init(struct mt76x2_dev *dev) | 271 | int mt76x2u_mcu_fw_init(struct mt76x02_dev *dev) |
272 | { | 272 | { |
273 | int err; | 273 | int err; |
274 | 274 | ||
@@ -279,7 +279,7 @@ int mt76x2u_mcu_fw_init(struct mt76x2_dev *dev) | |||
279 | return mt76x2u_mcu_load_firmware(dev); | 279 | return mt76x2u_mcu_load_firmware(dev); |
280 | } | 280 | } |
281 | 281 | ||
282 | int mt76x2u_mcu_init(struct mt76x2_dev *dev) | 282 | int mt76x2u_mcu_init(struct mt76x02_dev *dev) |
283 | { | 283 | { |
284 | int err; | 284 | int err; |
285 | 285 | ||
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/usb_phy.c b/drivers/net/wireless/mediatek/mt76/mt76x2/usb_phy.c index b14c073b0006..b11f8a6a6254 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2/usb_phy.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x2/usb_phy.c | |||
@@ -18,7 +18,7 @@ | |||
18 | #include "eeprom.h" | 18 | #include "eeprom.h" |
19 | #include "../mt76x02_phy.h" | 19 | #include "../mt76x02_phy.h" |
20 | 20 | ||
21 | void mt76x2u_phy_channel_calibrate(struct mt76x2_dev *dev) | 21 | void mt76x2u_phy_channel_calibrate(struct mt76x02_dev *dev) |
22 | { | 22 | { |
23 | struct ieee80211_channel *chan = dev->mt76.chandef.chan; | 23 | struct ieee80211_channel *chan = dev->mt76.chandef.chan; |
24 | bool is_5ghz = chan->band == NL80211_BAND_5GHZ; | 24 | bool is_5ghz = chan->band == NL80211_BAND_5GHZ; |
@@ -40,7 +40,7 @@ void mt76x2u_phy_channel_calibrate(struct mt76x2_dev *dev) | |||
40 | } | 40 | } |
41 | 41 | ||
42 | static void | 42 | static void |
43 | mt76x2u_phy_update_channel_gain(struct mt76x2_dev *dev) | 43 | mt76x2u_phy_update_channel_gain(struct mt76x02_dev *dev) |
44 | { | 44 | { |
45 | u8 channel = dev->mt76.chandef.chan->hw_value; | 45 | u8 channel = dev->mt76.chandef.chan->hw_value; |
46 | int freq, freq1; | 46 | int freq, freq1; |
@@ -79,9 +79,9 @@ mt76x2u_phy_update_channel_gain(struct mt76x2_dev *dev) | |||
79 | 79 | ||
80 | void mt76x2u_phy_calibrate(struct work_struct *work) | 80 | void mt76x2u_phy_calibrate(struct work_struct *work) |
81 | { | 81 | { |
82 | struct mt76x2_dev *dev; | 82 | struct mt76x02_dev *dev; |
83 | 83 | ||
84 | dev = container_of(work, struct mt76x2_dev, cal_work.work); | 84 | dev = container_of(work, struct mt76x02_dev, cal_work.work); |
85 | mt76x2_phy_tssi_compensate(dev, false); | 85 | mt76x2_phy_tssi_compensate(dev, false); |
86 | mt76x2u_phy_update_channel_gain(dev); | 86 | mt76x2u_phy_update_channel_gain(dev); |
87 | 87 | ||
@@ -89,7 +89,7 @@ void mt76x2u_phy_calibrate(struct work_struct *work) | |||
89 | MT_CALIBRATE_INTERVAL); | 89 | MT_CALIBRATE_INTERVAL); |
90 | } | 90 | } |
91 | 91 | ||
92 | int mt76x2u_phy_set_channel(struct mt76x2_dev *dev, | 92 | int mt76x2u_phy_set_channel(struct mt76x02_dev *dev, |
93 | struct cfg80211_chan_def *chandef) | 93 | struct cfg80211_chan_def *chandef) |
94 | { | 94 | { |
95 | u32 ext_cca_chan[4] = { | 95 | u32 ext_cca_chan[4] = { |