Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
2eb05816
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
2eb05816
编写于
8月 26, 2011
作者:
S
Stanislaw Gruszka
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
iwlegacy: s/IL_RATE/RATE/
Signed-off-by:
N
Stanislaw Gruszka
<
sgruszka@redhat.com
>
上级
6ce1dc45
变更
13
展开全部
隐藏空白更改
内联
并排
Showing
13 changed file
with
364 addition
and
364 deletion
+364
-364
drivers/net/wireless/iwlegacy/iwl-3945-rs.c
drivers/net/wireless/iwlegacy/iwl-3945-rs.c
+80
-80
drivers/net/wireless/iwlegacy/iwl-3945.c
drivers/net/wireless/iwlegacy/iwl-3945.c
+46
-46
drivers/net/wireless/iwlegacy/iwl-3945.h
drivers/net/wireless/iwlegacy/iwl-3945.h
+2
-2
drivers/net/wireless/iwlegacy/iwl-4965-lib.c
drivers/net/wireless/iwlegacy/iwl-4965-lib.c
+4
-4
drivers/net/wireless/iwlegacy/iwl-4965-rs.c
drivers/net/wireless/iwlegacy/iwl-4965-rs.c
+90
-90
drivers/net/wireless/iwlegacy/iwl-4965-sta.c
drivers/net/wireless/iwlegacy/iwl-4965-sta.c
+2
-2
drivers/net/wireless/iwlegacy/iwl-4965-tx.c
drivers/net/wireless/iwlegacy/iwl-4965-tx.c
+1
-1
drivers/net/wireless/iwlegacy/iwl-commands.h
drivers/net/wireless/iwlegacy/iwl-commands.h
+1
-1
drivers/net/wireless/iwlegacy/iwl-core.c
drivers/net/wireless/iwlegacy/iwl-core.c
+8
-8
drivers/net/wireless/iwlegacy/iwl-legacy-rs.h
drivers/net/wireless/iwlegacy/iwl-legacy-rs.h
+122
-122
drivers/net/wireless/iwlegacy/iwl-sta.c
drivers/net/wireless/iwlegacy/iwl-sta.c
+1
-1
drivers/net/wireless/iwlegacy/iwl3945-base.c
drivers/net/wireless/iwlegacy/iwl3945-base.c
+4
-4
drivers/net/wireless/iwlegacy/iwl4965-base.c
drivers/net/wireless/iwlegacy/iwl4965-base.c
+3
-3
未找到文件。
drivers/net/wireless/iwlegacy/iwl-3945-rs.c
浏览文件 @
2eb05816
...
...
@@ -42,19 +42,19 @@
#define RS_NAME "iwl-3945-rs"
static
s32
il3945_expected_tpt_g
[
IL_
RATE_COUNT_3945
]
=
{
static
s32
il3945_expected_tpt_g
[
RATE_COUNT_3945
]
=
{
7
,
13
,
35
,
58
,
0
,
0
,
76
,
104
,
130
,
168
,
191
,
202
};
static
s32
il3945_expected_tpt_g_prot
[
IL_
RATE_COUNT_3945
]
=
{
static
s32
il3945_expected_tpt_g_prot
[
RATE_COUNT_3945
]
=
{
7
,
13
,
35
,
58
,
0
,
0
,
0
,
80
,
93
,
113
,
123
,
125
};
static
s32
il3945_expected_tpt_a
[
IL_
RATE_COUNT_3945
]
=
{
static
s32
il3945_expected_tpt_a
[
RATE_COUNT_3945
]
=
{
0
,
0
,
0
,
0
,
40
,
57
,
72
,
98
,
121
,
154
,
177
,
186
};
static
s32
il3945_expected_tpt_b
[
IL_
RATE_COUNT_3945
]
=
{
static
s32
il3945_expected_tpt_b
[
RATE_COUNT_3945
]
=
{
7
,
13
,
35
,
58
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
};
...
...
@@ -64,39 +64,39 @@ struct il3945_tpt_entry {
};
static
struct
il3945_tpt_entry
il3945_tpt_table_a
[]
=
{
{
-
60
,
IL_
RATE_54M_INDEX
},
{
-
64
,
IL_
RATE_48M_INDEX
},
{
-
72
,
IL_
RATE_36M_INDEX
},
{
-
80
,
IL_
RATE_24M_INDEX
},
{
-
84
,
IL_
RATE_18M_INDEX
},
{
-
85
,
IL_
RATE_12M_INDEX
},
{
-
87
,
IL_
RATE_9M_INDEX
},
{
-
89
,
IL_
RATE_6M_INDEX
}
{
-
60
,
RATE_54M_INDEX
},
{
-
64
,
RATE_48M_INDEX
},
{
-
72
,
RATE_36M_INDEX
},
{
-
80
,
RATE_24M_INDEX
},
{
-
84
,
RATE_18M_INDEX
},
{
-
85
,
RATE_12M_INDEX
},
{
-
87
,
RATE_9M_INDEX
},
{
-
89
,
RATE_6M_INDEX
}
};
static
struct
il3945_tpt_entry
il3945_tpt_table_g
[]
=
{
{
-
60
,
IL_
RATE_54M_INDEX
},
{
-
64
,
IL_
RATE_48M_INDEX
},
{
-
68
,
IL_
RATE_36M_INDEX
},
{
-
80
,
IL_
RATE_24M_INDEX
},
{
-
84
,
IL_
RATE_18M_INDEX
},
{
-
85
,
IL_
RATE_12M_INDEX
},
{
-
86
,
IL_
RATE_11M_INDEX
},
{
-
88
,
IL_
RATE_5M_INDEX
},
{
-
90
,
IL_
RATE_2M_INDEX
},
{
-
92
,
IL_
RATE_1M_INDEX
}
{
-
60
,
RATE_54M_INDEX
},
{
-
64
,
RATE_48M_INDEX
},
{
-
68
,
RATE_36M_INDEX
},
{
-
80
,
RATE_24M_INDEX
},
{
-
84
,
RATE_18M_INDEX
},
{
-
85
,
RATE_12M_INDEX
},
{
-
86
,
RATE_11M_INDEX
},
{
-
88
,
RATE_5M_INDEX
},
{
-
90
,
RATE_2M_INDEX
},
{
-
92
,
RATE_1M_INDEX
}
};
#define
IL_
RATE_MAX_WINDOW 62
#define
IL_
RATE_FLUSH (3*HZ)
#define
IL_
RATE_WIN_FLUSH (HZ/2)
#define RATE_MAX_WINDOW 62
#define RATE_FLUSH (3*HZ)
#define RATE_WIN_FLUSH (HZ/2)
#define IL39_RATE_HIGH_TH 11520
#define IL_SUCCESS_UP_TH 8960
#define IL_SUCCESS_DOWN_TH 10880
#define
IL_
RATE_MIN_FAILURE_TH 6
#define
IL_
RATE_MIN_SUCCESS_TH 8
#define
IL_
RATE_DECREASE_TH 1920
#define
IL_
RATE_RETRY_TH 15
#define RATE_MIN_FAILURE_TH 6
#define RATE_MIN_SUCCESS_TH 8
#define RATE_DECREASE_TH 1920
#define RATE_RETRY_TH 15
static
u8
il3945_get_rate_index_by_rssi
(
s32
rssi
,
enum
ieee80211_band
band
)
{
...
...
@@ -157,16 +157,16 @@ static int il3945_rate_scale_flush_wins(struct il3945_rs_sta *rs_sta)
/*
* For each rate, if we have collected data on that rate
* and it has been more than
IL_
RATE_WIN_FLUSH
* and it has been more than RATE_WIN_FLUSH
* since we flushed, clear out the gathered stats
*/
for
(
i
=
0
;
i
<
IL_
RATE_COUNT_3945
;
i
++
)
{
for
(
i
=
0
;
i
<
RATE_COUNT_3945
;
i
++
)
{
if
(
!
rs_sta
->
win
[
i
].
counter
)
continue
;
spin_lock_irqsave
(
&
rs_sta
->
lock
,
flags
);
if
(
time_after
(
jiffies
,
rs_sta
->
win
[
i
].
stamp
+
IL_
RATE_WIN_FLUSH
))
{
RATE_WIN_FLUSH
))
{
D_RATE
(
"flushing %d samples of rate "
"index %d
\n
"
,
rs_sta
->
win
[
i
].
counter
,
i
);
...
...
@@ -179,8 +179,8 @@ static int il3945_rate_scale_flush_wins(struct il3945_rs_sta *rs_sta)
return
unflushed
;
}
#define
IL_
RATE_FLUSH_MAX 5000
/* msec */
#define
IL_
RATE_FLUSH_MIN 50
/* msec */
#define RATE_FLUSH_MAX 5000
/* msec */
#define RATE_FLUSH_MIN 50
/* msec */
#define IL_AVERAGE_PACKETS 1500
static
void
il3945_bg_rate_scale_flush
(
unsigned
long
data
)
...
...
@@ -217,12 +217,12 @@ static void il3945_bg_rate_scale_flush(unsigned long data)
if
(
pps
)
{
duration
=
(
IL_AVERAGE_PACKETS
*
1000
)
/
pps
;
if
(
duration
<
IL_
RATE_FLUSH_MIN
)
duration
=
IL_
RATE_FLUSH_MIN
;
else
if
(
duration
>
IL_
RATE_FLUSH_MAX
)
duration
=
IL_
RATE_FLUSH_MAX
;
if
(
duration
<
RATE_FLUSH_MIN
)
duration
=
RATE_FLUSH_MIN
;
else
if
(
duration
>
RATE_FLUSH_MAX
)
duration
=
RATE_FLUSH_MAX
;
}
else
duration
=
IL_
RATE_FLUSH_MAX
;
duration
=
RATE_FLUSH_MAX
;
rs_sta
->
flush_time
=
msecs_to_jiffies
(
duration
);
...
...
@@ -234,7 +234,7 @@ static void il3945_bg_rate_scale_flush(unsigned long data)
rs_sta
->
last_partial_flush
=
jiffies
;
}
else
{
rs_sta
->
flush_time
=
IL_
RATE_FLUSH
;
rs_sta
->
flush_time
=
RATE_FLUSH
;
rs_sta
->
flush_pending
=
0
;
}
/* If there weren't any unflushed entries, we don't schedule the timer
...
...
@@ -278,13 +278,13 @@ static void il3945_collect_tx_data(struct il3945_rs_sta *rs_sta,
* we keep these bitmaps!).
* */
while
(
retries
>
0
)
{
if
(
win
->
counter
>=
IL_
RATE_MAX_WINDOW
)
{
if
(
win
->
counter
>=
RATE_MAX_WINDOW
)
{
/* remove earliest */
win
->
counter
=
IL_
RATE_MAX_WINDOW
-
1
;
win
->
counter
=
RATE_MAX_WINDOW
-
1
;
if
(
win
->
data
&
(
1ULL
<<
(
IL_
RATE_MAX_WINDOW
-
1
)))
{
win
->
data
&=
~
(
1ULL
<<
(
IL_
RATE_MAX_WINDOW
-
1
));
if
(
win
->
data
&
(
1ULL
<<
(
RATE_MAX_WINDOW
-
1
)))
{
win
->
data
&=
~
(
1ULL
<<
(
RATE_MAX_WINDOW
-
1
));
win
->
success_counter
--
;
}
}
...
...
@@ -315,8 +315,8 @@ static void il3945_collect_tx_data(struct il3945_rs_sta *rs_sta,
fail_count
=
win
->
counter
-
win
->
success_counter
;
/* Calculate average throughput, if we have enough history. */
if
(
fail_count
>=
IL_
RATE_MIN_FAILURE_TH
||
win
->
success_counter
>=
IL_
RATE_MIN_SUCCESS_TH
)
if
(
fail_count
>=
RATE_MIN_FAILURE_TH
||
win
->
success_counter
>=
RATE_MIN_SUCCESS_TH
)
win
->
average_tpt
=
((
win
->
success_ratio
*
rs_sta
->
expected_tpt
[
index
]
+
64
)
/
128
);
else
...
...
@@ -351,20 +351,20 @@ void il3945_rs_rate_init(struct il_priv *il, struct ieee80211_sta *sta, u8 sta_i
rs_sta
->
il
=
il
;
rs_sta
->
start_rate
=
IL_
RATE_INVALID
;
rs_sta
->
start_rate
=
RATE_INVALID
;
/* default to just 802.11b */
rs_sta
->
expected_tpt
=
il3945_expected_tpt_b
;
rs_sta
->
last_partial_flush
=
jiffies
;
rs_sta
->
last_flush
=
jiffies
;
rs_sta
->
flush_time
=
IL_
RATE_FLUSH
;
rs_sta
->
flush_time
=
RATE_FLUSH
;
rs_sta
->
last_tx_packets
=
0
;
rs_sta
->
rate_scale_flush
.
data
=
(
unsigned
long
)
rs_sta
;
rs_sta
->
rate_scale_flush
.
function
=
il3945_bg_rate_scale_flush
;
for
(
i
=
0
;
i
<
IL_
RATE_COUNT_3945
;
i
++
)
for
(
i
=
0
;
i
<
RATE_COUNT_3945
;
i
++
)
il3945_clear_win
(
&
rs_sta
->
win
[
i
]);
/* TODO: what is a good starting rate for STA? About middle? Maybe not
...
...
@@ -457,11 +457,11 @@ static void il3945_rs_tx_status(void *il_rate, struct ieee80211_supported_band *
retries
=
info
->
status
.
rates
[
0
].
count
;
/* Sanity Check for retries */
if
(
retries
>
IL_
RATE_RETRY_TH
)
retries
=
IL_
RATE_RETRY_TH
;
if
(
retries
>
RATE_RETRY_TH
)
retries
=
RATE_RETRY_TH
;
first_index
=
sband
->
bitrates
[
info
->
status
.
rates
[
0
].
idx
].
hw_value
;
if
(
first_index
<
0
||
first_index
>=
IL_
RATE_COUNT_3945
)
{
if
(
first_index
<
0
||
first_index
>=
RATE_COUNT_3945
)
{
D_RATE
(
"leave: Rate out of bounds: %d
\n
"
,
first_index
);
return
;
}
...
...
@@ -549,8 +549,8 @@ static void il3945_rs_tx_status(void *il_rate, struct ieee80211_supported_band *
static
u16
il3945_get_adjacent_rate
(
struct
il3945_rs_sta
*
rs_sta
,
u8
index
,
u16
rate_mask
,
enum
ieee80211_band
band
)
{
u8
high
=
IL_
RATE_INVALID
;
u8
low
=
IL_
RATE_INVALID
;
u8
high
=
RATE_INVALID
;
u8
low
=
RATE_INVALID
;
struct
il_priv
*
il
__maybe_unused
=
rs_sta
->
il
;
/* 802.11A walks to the next literal adjacent rate in
...
...
@@ -570,7 +570,7 @@ static u16 il3945_get_adjacent_rate(struct il3945_rs_sta *rs_sta,
/* Find the next rate that is in the rate mask */
i
=
index
+
1
;
for
(
mask
=
(
1
<<
i
);
i
<
IL_
RATE_COUNT_3945
;
for
(
mask
=
(
1
<<
i
);
i
<
RATE_COUNT_3945
;
i
++
,
mask
<<=
1
)
{
if
(
rate_mask
&
mask
)
{
high
=
i
;
...
...
@@ -582,12 +582,12 @@ static u16 il3945_get_adjacent_rate(struct il3945_rs_sta *rs_sta,
}
low
=
index
;
while
(
low
!=
IL_
RATE_INVALID
)
{
while
(
low
!=
RATE_INVALID
)
{
if
(
rs_sta
->
tgg
)
low
=
il3945_rates
[
low
].
prev_rs_tgg
;
else
low
=
il3945_rates
[
low
].
prev_rs
;
if
(
low
==
IL_
RATE_INVALID
)
if
(
low
==
RATE_INVALID
)
break
;
if
(
rate_mask
&
(
1
<<
low
))
break
;
...
...
@@ -595,12 +595,12 @@ static u16 il3945_get_adjacent_rate(struct il3945_rs_sta *rs_sta,
}
high
=
index
;
while
(
high
!=
IL_
RATE_INVALID
)
{
while
(
high
!=
RATE_INVALID
)
{
if
(
rs_sta
->
tgg
)
high
=
il3945_rates
[
high
].
next_rs_tgg
;
else
high
=
il3945_rates
[
high
].
next_rs
;
if
(
high
==
IL_
RATE_INVALID
)
if
(
high
==
RATE_INVALID
)
break
;
if
(
rate_mask
&
(
1
<<
high
))
break
;
...
...
@@ -631,8 +631,8 @@ static void il3945_rs_get_rate(void *il_r, struct ieee80211_sta *sta,
{
struct
ieee80211_supported_band
*
sband
=
txrc
->
sband
;
struct
sk_buff
*
skb
=
txrc
->
skb
;
u8
low
=
IL_
RATE_INVALID
;
u8
high
=
IL_
RATE_INVALID
;
u8
low
=
RATE_INVALID
;
u8
high
=
RATE_INVALID
;
u16
high_low
;
int
index
;
struct
il3945_rs_sta
*
rs_sta
=
il_sta
;
...
...
@@ -665,10 +665,10 @@ static void il3945_rs_get_rate(void *il_r, struct ieee80211_sta *sta,
max_rate_idx
=
txrc
->
max_rate_idx
;
if
(
sband
->
band
==
IEEE80211_BAND_5GHZ
&&
max_rate_idx
!=
-
1
)
max_rate_idx
+=
IL_FIRST_OFDM_RATE
;
if
(
max_rate_idx
<
0
||
max_rate_idx
>=
IL_
RATE_COUNT
)
if
(
max_rate_idx
<
0
||
max_rate_idx
>=
RATE_COUNT
)
max_rate_idx
=
-
1
;
index
=
min
(
rs_sta
->
last_txrate_idx
&
0xffff
,
IL_
RATE_COUNT_3945
-
1
);
index
=
min
(
rs_sta
->
last_txrate_idx
&
0xffff
,
RATE_COUNT_3945
-
1
);
if
(
sband
->
band
==
IEEE80211_BAND_5GHZ
)
rate_mask
=
rate_mask
<<
IL_FIRST_OFDM_RATE
;
...
...
@@ -678,11 +678,11 @@ static void il3945_rs_get_rate(void *il_r, struct ieee80211_sta *sta,
/* for recent assoc, choose best rate regarding
* to rssi value
*/
if
(
rs_sta
->
start_rate
!=
IL_
RATE_INVALID
)
{
if
(
rs_sta
->
start_rate
!=
RATE_INVALID
)
{
if
(
rs_sta
->
start_rate
<
index
&&
(
rate_mask
&
(
1
<<
rs_sta
->
start_rate
)))
index
=
rs_sta
->
start_rate
;
rs_sta
->
start_rate
=
IL_
RATE_INVALID
;
rs_sta
->
start_rate
=
RATE_INVALID
;
}
/* force user max rate if set by user */
...
...
@@ -695,8 +695,8 @@ static void il3945_rs_get_rate(void *il_r, struct ieee80211_sta *sta,
fail_count
=
win
->
counter
-
win
->
success_counter
;
if
(
fail_count
<
IL_
RATE_MIN_FAILURE_TH
&&
win
->
success_counter
<
IL_
RATE_MIN_SUCCESS_TH
)
{
if
(
fail_count
<
RATE_MIN_FAILURE_TH
&&
win
->
success_counter
<
RATE_MIN_SUCCESS_TH
)
{
spin_unlock_irqrestore
(
&
rs_sta
->
lock
,
flags
);
D_RATE
(
"Invalid average_tpt on rate %d: "
...
...
@@ -722,13 +722,13 @@ static void il3945_rs_get_rate(void *il_r, struct ieee80211_sta *sta,
/* If user set max rate, dont allow higher than user constrain */
if
(
max_rate_idx
!=
-
1
&&
max_rate_idx
<
high
)
high
=
IL_
RATE_INVALID
;
high
=
RATE_INVALID
;
/* Collect Measured throughputs of adjacent rates */
if
(
low
!=
IL_
RATE_INVALID
)
if
(
low
!=
RATE_INVALID
)
low_tpt
=
rs_sta
->
win
[
low
].
average_tpt
;
if
(
high
!=
IL_
RATE_INVALID
)
if
(
high
!=
RATE_INVALID
)
high_tpt
=
rs_sta
->
win
[
high
].
average_tpt
;
spin_unlock_irqrestore
(
&
rs_sta
->
lock
,
flags
);
...
...
@@ -736,7 +736,7 @@ static void il3945_rs_get_rate(void *il_r, struct ieee80211_sta *sta,
scale_action
=
0
;
/* Low success ratio , need to drop the rate */
if
(
win
->
success_ratio
<
IL_
RATE_DECREASE_TH
||
!
current_tpt
)
{
if
(
win
->
success_ratio
<
RATE_DECREASE_TH
||
!
current_tpt
)
{
D_RATE
(
"decrease rate because of low success_ratio
\n
"
);
scale_action
=
-
1
;
/* No throughput measured yet for adjacent rates,
...
...
@@ -744,9 +744,9 @@ static void il3945_rs_get_rate(void *il_r, struct ieee80211_sta *sta,
}
else
if
(
low_tpt
==
IL_INVALID_VALUE
&&
high_tpt
==
IL_INVALID_VALUE
)
{
if
(
high
!=
IL_RATE_INVALID
&&
win
->
success_ratio
>=
IL_
RATE_INCREASE_TH
)
if
(
high
!=
RATE_INVALID
&&
win
->
success_ratio
>=
RATE_INCREASE_TH
)
scale_action
=
1
;
else
if
(
low
!=
IL_
RATE_INVALID
)
else
if
(
low
!=
RATE_INVALID
)
scale_action
=
0
;
/* Both adjacent throughputs are measured, but neither one has
...
...
@@ -768,7 +768,7 @@ static void il3945_rs_get_rate(void *il_r, struct ieee80211_sta *sta,
/* High rate has better throughput, Increase
* rate */
if
(
high_tpt
>
current_tpt
&&
win
->
success_ratio
>=
IL_
RATE_INCREASE_TH
)
win
->
success_ratio
>=
RATE_INCREASE_TH
)
scale_action
=
1
;
else
{
D_RATE
(
...
...
@@ -780,7 +780,7 @@ static void il3945_rs_get_rate(void *il_r, struct ieee80211_sta *sta,
D_RATE
(
"decrease rate because of low tpt
\n
"
);
scale_action
=
-
1
;
}
else
if
(
win
->
success_ratio
>=
IL_
RATE_INCREASE_TH
)
{
}
else
if
(
win
->
success_ratio
>=
RATE_INCREASE_TH
)
{
/* Lower rate has better
* throughput,decrease rate */
scale_action
=
1
;
...
...
@@ -790,8 +790,8 @@ static void il3945_rs_get_rate(void *il_r, struct ieee80211_sta *sta,
/* Sanity check; asked for decrease, but success rate or throughput
* has been good at old rate. Don't change it. */
if
(
scale_action
==
-
1
&&
low
!=
IL_
RATE_INVALID
&&
(
win
->
success_ratio
>
IL_
RATE_HIGH_TH
||
if
(
scale_action
==
-
1
&&
low
!=
RATE_INVALID
&&
(
win
->
success_ratio
>
RATE_HIGH_TH
||
current_tpt
>
100
*
rs_sta
->
expected_tpt
[
low
]))
scale_action
=
0
;
...
...
@@ -799,13 +799,13 @@ static void il3945_rs_get_rate(void *il_r, struct ieee80211_sta *sta,
case
-
1
:
/* Decrese rate */
if
(
low
!=
IL_
RATE_INVALID
)
if
(
low
!=
RATE_INVALID
)
index
=
low
;
break
;
case
1
:
/* Increase rate */
if
(
high
!=
IL_
RATE_INVALID
)
if
(
high
!=
RATE_INVALID
)
index
=
high
;
break
;
...
...
@@ -860,7 +860,7 @@ static ssize_t il3945_sta_dbgfs_stats_table_read(struct file *file,
lq_sta
->
tx_packets
,
lq_sta
->
last_txrate_idx
,
lq_sta
->
start_rate
,
jiffies_to_msecs
(
lq_sta
->
flush_time
));
for
(
j
=
0
;
j
<
IL_
RATE_COUNT_3945
;
j
++
)
{
for
(
j
=
0
;
j
<
RATE_COUNT_3945
;
j
++
)
{
desc
+=
sprintf
(
buff
+
desc
,
"counter=%d success=%d %%=%d
\n
"
,
lq_sta
->
win
[
j
].
counter
,
...
...
drivers/net/wireless/iwlegacy/iwl-3945.c
浏览文件 @
2eb05816
...
...
@@ -52,26 +52,26 @@
#include "iwl-3945-debugfs.h"
#define IL_DECLARE_RATE_INFO(r, ip, in, rp, rn, pp, np) \
[
IL_RATE_##r##M_INDEX] = { IL_
RATE_##r##M_PLCP, \
IL_
RATE_##r##M_IEEE, \
IL_
RATE_##ip##M_INDEX, \
IL_
RATE_##in##M_INDEX, \
IL_
RATE_##rp##M_INDEX, \
IL_
RATE_##rn##M_INDEX, \
IL_
RATE_##pp##M_INDEX, \
IL_
RATE_##np##M_INDEX, \
IL_
RATE_##r##M_INDEX_TABLE, \
IL_
RATE_##ip##M_INDEX_TABLE }
[
RATE_##r##M_INDEX] = {
RATE_##r##M_PLCP, \
RATE_##r##M_IEEE, \
RATE_##ip##M_INDEX, \
RATE_##in##M_INDEX, \
RATE_##rp##M_INDEX, \
RATE_##rn##M_INDEX, \
RATE_##pp##M_INDEX, \
RATE_##np##M_INDEX, \
RATE_##r##M_INDEX_TABLE, \
RATE_##ip##M_INDEX_TABLE }
/*
* Parameter order:
* rate, prev rate, next rate, prev tgg rate, next tgg rate
*
* If there isn't a valid next or previous rate then INV is used which
* maps to
IL_
RATE_INVALID
* maps to RATE_INVALID
*
*/
const
struct
il3945_rate_info
il3945_rates
[
IL_
RATE_COUNT_3945
]
=
{
const
struct
il3945_rate_info
il3945_rates
[
RATE_COUNT_3945
]
=
{
IL_DECLARE_RATE_INFO
(
1
,
INV
,
2
,
INV
,
2
,
INV
,
2
),
/* 1mbps */
IL_DECLARE_RATE_INFO
(
2
,
1
,
5
,
1
,
5
,
1
,
5
),
/* 2mbps */
IL_DECLARE_RATE_INFO
(
5
,
2
,
6
,
2
,
11
,
2
,
11
),
/*5.5mbps */
...
...
@@ -90,7 +90,7 @@ static inline u8 il3945_get_prev_ieee_rate(u8 rate_index)
{
u8
rate
=
il3945_rates
[
rate_index
].
prev_ieee
;
if
(
rate
==
IL_
RATE_INVALID
)
if
(
rate
==
RATE_INVALID
)
rate
=
rate_index
;
return
rate
;
}
...
...
@@ -194,7 +194,7 @@ static int il3945_hwrate_to_plcp_idx(u8 plcp)
{
int
idx
;
for
(
idx
=
0
;
idx
<
IL_
RATE_COUNT_3945
;
idx
++
)
for
(
idx
=
0
;
idx
<
RATE_COUNT_3945
;
idx
++
)
if
(
il3945_rates
[
idx
].
plcp
==
plcp
)
return
idx
;
return
-
1
;
...
...
@@ -246,16 +246,16 @@ int il3945_rs_next_rate(struct il_priv *il, int rate)
switch
(
il
->
band
)
{
case
IEEE80211_BAND_5GHZ
:
if
(
rate
==
IL_
RATE_12M_INDEX
)
next_rate
=
IL_
RATE_9M_INDEX
;
else
if
(
rate
==
IL_
RATE_6M_INDEX
)
next_rate
=
IL_
RATE_6M_INDEX
;
if
(
rate
==
RATE_12M_INDEX
)
next_rate
=
RATE_9M_INDEX
;
else
if
(
rate
==
RATE_6M_INDEX
)
next_rate
=
RATE_6M_INDEX
;
break
;
case
IEEE80211_BAND_2GHZ
:
if
(
!
(
il
->
_3945
.
sta_supp_rates
&
IL_OFDM_RATES_MASK
)
&&
il_is_associated
(
il
))
{
if
(
rate
==
IL_
RATE_11M_INDEX
)
next_rate
=
IL_
RATE_5M_INDEX
;
if
(
rate
==
RATE_11M_INDEX
)
next_rate
=
RATE_5M_INDEX
;
}
break
;
...
...
@@ -675,7 +675,7 @@ void il3945_hw_build_tx_cmd_rate(struct il_priv *il,
int
sta_id
,
int
tx_id
)
{
u16
hw_value
=
ieee80211_get_tx_rate
(
il
->
hw
,
info
)
->
hw_value
;
u16
rate_index
=
min
(
hw_value
&
0xffff
,
IL_
RATE_COUNT_3945
);
u16
rate_index
=
min
(
hw_value
&
0xffff
,
RATE_COUNT_3945
);
u16
rate_mask
;
int
rate
;
u8
rts_retry_limit
;
...
...
@@ -689,7 +689,7 @@ void il3945_hw_build_tx_cmd_rate(struct il_priv *il,
/* We need to figure out how to get the sta->supp_rates while
* in this running context */
rate_mask
=
IL_
RATES_MASK_3945
;
rate_mask
=
RATES_MASK_3945
;
/* Set retry limit on DATA packets and Probe Responses*/
if
(
ieee80211_is_probe_resp
(
fc
))
...
...
@@ -1330,7 +1330,7 @@ static void il3945_hw_reg_set_scan_power(struct il_priv *il, u32 scan_tbl_index,
/* use this channel group's 6Mbit clipping/saturation pwr,
* but cap at regulatory scan power restriction (set during init
* based on eeprom channel data) for this channel. */
power
=
min
(
ch_info
->
scan_power
,
clip_pwrs
[
IL_
RATE_6M_INDEX_TABLE
]);
power
=
min
(
ch_info
->
scan_power
,
clip_pwrs
[
RATE_6M_INDEX_TABLE
]);
power
=
min
(
power
,
il
->
tx_power_user_lmt
);
scan_power_info
->
requested_power
=
power
;
...
...
@@ -1342,7 +1342,7 @@ static void il3945_hw_reg_set_scan_power(struct il_priv *il, u32 scan_tbl_index,
* *index*. */
power_index
=
ch_info
->
power_info
[
rate_index
].
power_table_index
-
(
power
-
ch_info
->
power_info
[
IL_
RATE_6M_INDEX_TABLE
].
requested_power
)
*
2
;
[
RATE_6M_INDEX_TABLE
].
requested_power
)
*
2
;
/* store reference index that we use when adjusting *all* scan
* powers. So we can accommodate user (all channel) or spectrum
...
...
@@ -1466,7 +1466,7 @@ static int il3945_hw_reg_set_new_power(struct il_priv *il,
power_info
=
ch_info
->
power_info
;
/* update OFDM Txpower settings */
for
(
i
=
IL_RATE_6M_INDEX_TABLE
;
i
<=
IL_
RATE_54M_INDEX_TABLE
;
for
(
i
=
RATE_6M_INDEX_TABLE
;
i
<=
RATE_54M_INDEX_TABLE
;
i
++
,
++
power_info
)
{
int
delta_idx
;
...
...
@@ -1490,14 +1490,14 @@ static int il3945_hw_reg_set_new_power(struct il_priv *il,
* ... all CCK power settings for a given channel are the *same*. */
if
(
power_changed
)
{
power
=
ch_info
->
power_info
[
IL_
RATE_12M_INDEX_TABLE
].
ch_info
->
power_info
[
RATE_12M_INDEX_TABLE
].
requested_power
+
IL_CCK_FROM_OFDM_POWER_DIFF
;
/* do all CCK rates' il3945_channel_power_info structures */
for
(
i
=
IL_RATE_1M_INDEX_TABLE
;
i
<=
IL_
RATE_11M_INDEX_TABLE
;
i
++
)
{
for
(
i
=
RATE_1M_INDEX_TABLE
;
i
<=
RATE_11M_INDEX_TABLE
;
i
++
)
{
power_info
->
requested_power
=
power
;
power_info
->
base_power_index
=
ch_info
->
power_info
[
IL_
RATE_12M_INDEX_TABLE
].
ch_info
->
power_info
[
RATE_12M_INDEX_TABLE
].
base_power_index
+
IL_CCK_FROM_OFDM_INDEX_DIFF
;
++
power_info
;
}
...
...
@@ -1574,7 +1574,7 @@ static int il3945_hw_reg_comp_txpower_temp(struct il_priv *il)
ref_temp
);
/* set tx power value for all rates, OFDM and CCK */
for
(
rate_index
=
0
;
rate_index
<
IL_
RATE_COUNT_3945
;
for
(
rate_index
=
0
;
rate_index
<
RATE_COUNT_3945
;
rate_index
++
)
{
int
power_idx
=
ch_info
->
power_info
[
rate_index
].
base_power_index
;
...
...
@@ -1597,7 +1597,7 @@ static int il3945_hw_reg_comp_txpower_temp(struct il_priv *il)
for
(
scan_tbl_index
=
0
;
scan_tbl_index
<
IL_NUM_SCAN_RATES
;
scan_tbl_index
++
)
{
s32
actual_index
=
(
scan_tbl_index
==
0
)
?
IL_RATE_1M_INDEX_TABLE
:
IL_
RATE_6M_INDEX_TABLE
;
RATE_1M_INDEX_TABLE
:
RATE_6M_INDEX_TABLE
;
il3945_hw_reg_set_scan_power
(
il
,
scan_tbl_index
,
actual_index
,
clip_pwrs
,
ch_info
,
a_band
);
...
...
@@ -2010,21 +2010,21 @@ static void il3945_hw_reg_init_channel_groups(struct il_priv *il)
/* fill in channel group's nominal powers for each rate */
for
(
rate_index
=
0
;
rate_index
<
IL_
RATE_COUNT_3945
;
rate_index
++
,
clip_pwrs
++
)
{
rate_index
<
RATE_COUNT_3945
;
rate_index
++
,
clip_pwrs
++
)
{
switch
(
rate_index
)
{
case
IL_
RATE_36M_INDEX_TABLE
:
case
RATE_36M_INDEX_TABLE
:
if
(
i
==
0
)
/* B/G */
*
clip_pwrs
=
satur_pwr
;
else
/* A */
*
clip_pwrs
=
satur_pwr
-
5
;
break
;
case
IL_
RATE_48M_INDEX_TABLE
:
case
RATE_48M_INDEX_TABLE
:
if
(
i
==
0
)
*
clip_pwrs
=
satur_pwr
-
7
;
else
*
clip_pwrs
=
satur_pwr
-
10
;
break
;
case
IL_
RATE_54M_INDEX_TABLE
:
case
RATE_54M_INDEX_TABLE
:
if
(
i
==
0
)
*
clip_pwrs
=
satur_pwr
-
9
;
else
...
...
@@ -2139,7 +2139,7 @@ int il3945_txpower_set_from_eeprom(struct il_priv *il)
}
/* set tx power for CCK rates, based on OFDM 12 Mbit settings*/
pwr_info
=
&
ch_info
->
power_info
[
IL_
RATE_12M_INDEX_TABLE
];
pwr_info
=
&
ch_info
->
power_info
[
RATE_12M_INDEX_TABLE
];
power
=
pwr_info
->
requested_power
+
IL_CCK_FROM_OFDM_POWER_DIFF
;
pwr_index
=
pwr_info
->
power_table_index
+
...
...
@@ -2169,7 +2169,7 @@ int il3945_txpower_set_from_eeprom(struct il_priv *il)
for
(
scan_tbl_index
=
0
;
scan_tbl_index
<
IL_NUM_SCAN_RATES
;
scan_tbl_index
++
)
{
s32
actual_index
=
(
scan_tbl_index
==
0
)
?
IL_RATE_1M_INDEX_TABLE
:
IL_
RATE_6M_INDEX_TABLE
;
RATE_1M_INDEX_TABLE
:
RATE_6M_INDEX_TABLE
;
il3945_hw_reg_set_scan_power
(
il
,
scan_tbl_index
,
actual_index
,
clip_pwrs
,
ch_info
,
a_band
);
}
...
...
@@ -2289,7 +2289,7 @@ static int il3945_manage_ibss_station(struct il_priv *il,
il3945_sync_sta
(
il
,
vif_priv
->
ibss_bssid_sta_id
,
(
il
->
band
==
IEEE80211_BAND_5GHZ
)
?
IL_RATE_6M_PLCP
:
IL_
RATE_1M_PLCP
);
RATE_6M_PLCP
:
RATE_1M_PLCP
);
il3945_rate_scale_init
(
il
->
hw
,
vif_priv
->
ibss_bssid_sta_id
);
return
0
;
...
...
@@ -2326,17 +2326,17 @@ int il3945_init_hw_rate_table(struct il_priv *il)
D_RATE
(
"Select A mode rate scale
\n
"
);
/* If one of the following CCK rates is used,
* have it fall back to the 6M OFDM rate */
for
(
i
=
IL_
RATE_1M_INDEX_TABLE
;
i
<=
IL_
RATE_11M_INDEX_TABLE
;
i
++
)
for
(
i
=
RATE_1M_INDEX_TABLE
;
i
<=
RATE_11M_INDEX_TABLE
;
i
++
)
table
[
i
].
next_rate_index
=
il3945_rates
[
IL_FIRST_OFDM_RATE
].
table_rs_index
;
/* Don't fall back to CCK rates */
table
[
IL_
RATE_12M_INDEX_TABLE
].
next_rate_index
=
IL_
RATE_9M_INDEX_TABLE
;
table
[
RATE_12M_INDEX_TABLE
].
next_rate_index
=
RATE_9M_INDEX_TABLE
;
/* Don't drop out of OFDM rates */
table
[
IL_
RATE_6M_INDEX_TABLE
].
next_rate_index
=
table
[
RATE_6M_INDEX_TABLE
].
next_rate_index
=
il3945_rates
[
IL_FIRST_OFDM_RATE
].
table_rs_index
;
break
;
...
...
@@ -2349,14 +2349,14 @@ int il3945_init_hw_rate_table(struct il_priv *il)
il_is_associated
(
il
))
{
index
=
IL_FIRST_CCK_RATE
;
for
(
i
=
IL_
RATE_6M_INDEX_TABLE
;
i
<=
IL_
RATE_54M_INDEX_TABLE
;
i
++
)
for
(
i
=
RATE_6M_INDEX_TABLE
;
i
<=
RATE_54M_INDEX_TABLE
;
i
++
)
table
[
i
].
next_rate_index
=
il3945_rates
[
index
].
table_rs_index
;
index
=
IL_
RATE_11M_INDEX_TABLE
;
index
=
RATE_11M_INDEX_TABLE
;
/* CCK shouldn't fall back to OFDM... */
table
[
index
].
next_rate_index
=
IL_
RATE_5M_INDEX_TABLE
;
table
[
index
].
next_rate_index
=
RATE_5M_INDEX_TABLE
;
}
break
;
...
...
drivers/net/wireless/iwlegacy/iwl-3945.h
浏览文件 @
2eb05816
...
...
@@ -96,7 +96,7 @@ struct il3945_rs_sta {
u8
flush_pending
;
u8
start_rate
;
struct
timer_list
rate_scale_flush
;
struct
il3945_rate_scale_data
win
[
IL_
RATE_COUNT_3945
];
struct
il3945_rate_scale_data
win
[
RATE_COUNT_3945
];
#ifdef CONFIG_MAC80211_DEBUGFS
struct
dentry
*
rs_sta_dbgfs_stats_table_file
;
#endif
...
...
@@ -300,7 +300,7 @@ int il3945_request_scan(struct il_priv *il, struct ieee80211_vif *vif);
void
il3945_post_scan
(
struct
il_priv
*
il
);
/* rates */
extern
const
struct
il3945_rate_info
il3945_rates
[
IL_
RATE_COUNT_3945
];
extern
const
struct
il3945_rate_info
il3945_rates
[
RATE_COUNT_3945
];
/* Requires full declaration of il_priv before including */
#include "iwl-io.h"
...
...
drivers/net/wireless/iwlegacy/iwl-4965-lib.c
浏览文件 @
2eb05816
...
...
@@ -423,7 +423,7 @@ int il4965_hwrate_to_mac80211_idx(u32 rate_n_flags, enum ieee80211_band band)
}
else
{
if
(
band
==
IEEE80211_BAND_5GHZ
)
band_offset
=
IL_FIRST_OFDM_RATE
;
for
(
idx
=
band_offset
;
idx
<
IL_
RATE_COUNT_LEGACY
;
idx
++
)
for
(
idx
=
band_offset
;
idx
<
RATE_COUNT_LEGACY
;
idx
++
)
if
(
il_rates
[
idx
].
plcp
==
(
rate_n_flags
&
0xFF
))
return
idx
-
band_offset
;
}
...
...
@@ -870,14 +870,14 @@ int il4965_request_scan(struct il_priv *il, struct ieee80211_vif *vif)
RXON_FLG_CHANNEL_MODE_MSK
)
>>
RXON_FLG_CHANNEL_MODE_POS
;
if
(
chan_mod
==
CHANNEL_MODE_PURE_40
)
{
rate
=
IL_
RATE_6M_PLCP
;
rate
=
RATE_6M_PLCP
;
}
else
{
rate
=
IL_
RATE_1M_PLCP
;
rate
=
RATE_1M_PLCP
;
rate_flags
=
RATE_MCS_CCK_MSK
;
}
break
;
case
IEEE80211_BAND_5GHZ
:
rate
=
IL_
RATE_6M_PLCP
;
rate
=
RATE_6M_PLCP
;
break
;
default:
IL_WARN
(
"Invalid scan band
\n
"
);
...
...
drivers/net/wireless/iwlegacy/iwl-4965-rs.c
浏览文件 @
2eb05816
此差异已折叠。
点击以展开。
drivers/net/wireless/iwlegacy/iwl-4965-sta.c
浏览文件 @
2eb05816
...
...
@@ -50,9 +50,9 @@ il4965_sta_alloc_lq(struct il_priv *il, u8 sta_id)
/* Set up the rate scaling to start at selected rate, fall back
* all the way down to 1M in IEEE order, and then spin on 1M */
if
(
il
->
band
==
IEEE80211_BAND_5GHZ
)
r
=
IL_
RATE_6M_INDEX
;
r
=
RATE_6M_INDEX
;
else
r
=
IL_
RATE_1M_INDEX
;
r
=
RATE_1M_INDEX
;
if
(
r
>=
IL_FIRST_CCK_RATE
&&
r
<=
IL_LAST_CCK_RATE
)
rate_flags
|=
RATE_MCS_CCK_MSK
;
...
...
drivers/net/wireless/iwlegacy/iwl-4965-tx.c
浏览文件 @
2eb05816
...
...
@@ -196,7 +196,7 @@ static void il4965_tx_cmd_build_rate(struct il_priv *il,
*/
rate_idx
=
info
->
control
.
rates
[
0
].
idx
;
if
((
info
->
control
.
rates
[
0
].
flags
&
IEEE80211_TX_RC_MCS
)
||
rate_idx
<
0
||
rate_idx
>
IL_
RATE_COUNT_LEGACY
)
rate_idx
<
0
||
rate_idx
>
RATE_COUNT_LEGACY
)
rate_idx
=
rate_lowest_index
(
&
il
->
bands
[
info
->
band
],
info
->
control
.
sta
);
/* For 5 GHZ band, remap mac80211 rate indices into driver indices */
...
...
drivers/net/wireless/iwlegacy/iwl-commands.h
浏览文件 @
2eb05816
...
...
@@ -2094,7 +2094,7 @@ struct il_link_quality_cmd {
* 4965 devices works its way through table when retrying Tx.
*/
struct
{
__le32
rate_n_flags
;
/* RATE_MCS_*,
IL_
RATE_* */
__le32
rate_n_flags
;
/* RATE_MCS_*, RATE_* */
}
rs_table
[
LINK_QUAL_MAX_RETRY_NUM
];
__le32
reserved2
;
}
__packed
;
...
...
drivers/net/wireless/iwlegacy/iwl-core.c
浏览文件 @
2eb05816
...
...
@@ -174,7 +174,7 @@ int il_init_geos(struct il_priv *il)
if
(
!
channels
)
return
-
ENOMEM
;
rates
=
kzalloc
((
sizeof
(
struct
ieee80211_rate
)
*
IL_
RATE_COUNT_LEGACY
),
rates
=
kzalloc
((
sizeof
(
struct
ieee80211_rate
)
*
RATE_COUNT_LEGACY
),
GFP_KERNEL
);
if
(
!
rates
)
{
kfree
(
channels
);
...
...
@@ -186,7 +186,7 @@ int il_init_geos(struct il_priv *il)
sband
->
channels
=
&
channels
[
ARRAY_SIZE
(
il_eeprom_band_1
)];
/* just OFDM */
sband
->
bitrates
=
&
rates
[
IL_FIRST_OFDM_RATE
];
sband
->
n_bitrates
=
IL_
RATE_COUNT_LEGACY
-
IL_FIRST_OFDM_RATE
;
sband
->
n_bitrates
=
RATE_COUNT_LEGACY
-
IL_FIRST_OFDM_RATE
;
if
(
il
->
cfg
->
sku
&
IL_SKU_N
)
il_init_ht_hw_capab
(
il
,
&
sband
->
ht_cap
,
...
...
@@ -196,7 +196,7 @@ int il_init_geos(struct il_priv *il)
sband
->
channels
=
channels
;
/* OFDM & CCK */
sband
->
bitrates
=
rates
;
sband
->
n_bitrates
=
IL_
RATE_COUNT_LEGACY
;
sband
->
n_bitrates
=
RATE_COUNT_LEGACY
;
if
(
il
->
cfg
->
sku
&
IL_SKU_N
)
il_init_ht_hw_capab
(
il
,
&
sband
->
ht_cap
,
...
...
@@ -454,8 +454,8 @@ il_check_rxon_cmd(struct il_priv *il, struct il_rxon_context *ctx)
}
/* make sure basic rates 6Mbps and 1Mbps are supported */
if
((
rxon
->
ofdm_basic_rates
&
IL_
RATE_6M_MASK
)
==
0
&&
(
rxon
->
cck_basic_rates
&
IL_
RATE_1M_MASK
)
==
0
)
{
if
((
rxon
->
ofdm_basic_rates
&
RATE_6M_MASK
)
==
0
&&
(
rxon
->
cck_basic_rates
&
RATE_1M_MASK
)
==
0
)
{
IL_WARN
(
"neither 1 nor 6 are basic
\n
"
);
error
=
true
;
}
...
...
@@ -566,9 +566,9 @@ u8 il_get_lowest_plcp(struct il_priv *il,
* the beacon skb from mac80211.
*/
if
(
ctx
->
staging
.
flags
&
RXON_FLG_BAND_24G_MSK
)
return
IL_
RATE_1M_PLCP
;
return
RATE_1M_PLCP
;
else
return
IL_
RATE_6M_PLCP
;
return
RATE_6M_PLCP
;
}
EXPORT_SYMBOL
(
il_get_lowest_plcp
);
...
...
@@ -835,7 +835,7 @@ void il_set_rate(struct il_priv *il)
for
(
i
=
0
;
i
<
hw
->
n_bitrates
;
i
++
)
{
rate
=
&
(
hw
->
bitrates
[
i
]);
if
(
rate
->
hw_value
<
IL_
RATE_COUNT_LEGACY
)
if
(
rate
->
hw_value
<
RATE_COUNT_LEGACY
)
il
->
active_rate
|=
(
1
<<
rate
->
hw_value
);
}
...
...
drivers/net/wireless/iwlegacy/iwl-legacy-rs.h
浏览文件 @
2eb05816
...
...
@@ -28,10 +28,10 @@
#define __il_rs_h__
struct
il_rate_info
{
u8
plcp
;
/* uCode API:
IL_
RATE_6M_PLCP, etc. */
u8
plcp_siso
;
/* uCode API:
IL_
RATE_SISO_6M_PLCP, etc. */
u8
plcp_mimo2
;
/* uCode API:
IL_
RATE_MIMO2_6M_PLCP, etc. */
u8
ieee
;
/* MAC header:
IL_
RATE_6M_IEEE, etc. */
u8
plcp
;
/* uCode API: RATE_6M_PLCP, etc. */
u8
plcp_siso
;
/* uCode API: RATE_SISO_6M_PLCP, etc. */
u8
plcp_mimo2
;
/* uCode API: RATE_MIMO2_6M_PLCP, etc. */
u8
ieee
;
/* MAC header: RATE_6M_IEEE, etc. */
u8
prev_ieee
;
/* previous rate in IEEE speeds */
u8
next_ieee
;
/* next rate in IEEE speeds */
u8
prev_rs
;
/* previous rate used in rs algo */
...
...
@@ -41,8 +41,8 @@ struct il_rate_info {
};
struct
il3945_rate_info
{
u8
plcp
;
/* uCode API:
IL_
RATE_6M_PLCP, etc. */
u8
ieee
;
/* MAC header:
IL_
RATE_6M_IEEE, etc. */
u8
plcp
;
/* uCode API: RATE_6M_PLCP, etc. */
u8
ieee
;
/* MAC header: RATE_6M_IEEE, etc. */
u8
prev_ieee
;
/* previous rate in IEEE speeds */
u8
next_ieee
;
/* next rate in IEEE speeds */
u8
prev_rs
;
/* previous rate used in rs algo */
...
...
@@ -56,153 +56,153 @@ struct il3945_rate_info {
/*
* These serve as indexes into
* struct il_rate_info il_rates[
IL_
RATE_COUNT];
* struct il_rate_info il_rates[RATE_COUNT];
*/
enum
{
IL_
RATE_1M_INDEX
=
0
,
IL_
RATE_2M_INDEX
,
IL_
RATE_5M_INDEX
,
IL_
RATE_11M_INDEX
,
IL_
RATE_6M_INDEX
,
IL_
RATE_9M_INDEX
,
IL_
RATE_12M_INDEX
,
IL_
RATE_18M_INDEX
,
IL_
RATE_24M_INDEX
,
IL_
RATE_36M_INDEX
,
IL_
RATE_48M_INDEX
,
IL_
RATE_54M_INDEX
,
IL_
RATE_60M_INDEX
,
IL_
RATE_COUNT
,
IL_RATE_COUNT_LEGACY
=
IL_
RATE_COUNT
-
1
,
/* Excluding 60M */
IL_RATE_COUNT_3945
=
IL_
RATE_COUNT
-
1
,
IL_RATE_INVM_INDEX
=
IL_
RATE_COUNT
,
IL_RATE_INVALID
=
IL_
RATE_COUNT
,
RATE_1M_INDEX
=
0
,
RATE_2M_INDEX
,
RATE_5M_INDEX
,
RATE_11M_INDEX
,
RATE_6M_INDEX
,
RATE_9M_INDEX
,
RATE_12M_INDEX
,
RATE_18M_INDEX
,
RATE_24M_INDEX
,
RATE_36M_INDEX
,
RATE_48M_INDEX
,
RATE_54M_INDEX
,
RATE_60M_INDEX
,
RATE_COUNT
,
RATE_COUNT_LEGACY
=
RATE_COUNT
-
1
,
/* Excluding 60M */
RATE_COUNT_3945
=
RATE_COUNT
-
1
,
RATE_INVM_INDEX
=
RATE_COUNT
,
RATE_INVALID
=
RATE_COUNT
,
};
enum
{
IL_
RATE_6M_INDEX_TABLE
=
0
,
IL_
RATE_9M_INDEX_TABLE
,
IL_
RATE_12M_INDEX_TABLE
,
IL_
RATE_18M_INDEX_TABLE
,
IL_
RATE_24M_INDEX_TABLE
,
IL_
RATE_36M_INDEX_TABLE
,
IL_
RATE_48M_INDEX_TABLE
,
IL_
RATE_54M_INDEX_TABLE
,
IL_
RATE_1M_INDEX_TABLE
,
IL_
RATE_2M_INDEX_TABLE
,
IL_
RATE_5M_INDEX_TABLE
,
IL_
RATE_11M_INDEX_TABLE
,
IL_RATE_INVM_INDEX_TABLE
=
IL_
RATE_INVM_INDEX
-
1
,
RATE_6M_INDEX_TABLE
=
0
,
RATE_9M_INDEX_TABLE
,
RATE_12M_INDEX_TABLE
,
RATE_18M_INDEX_TABLE
,
RATE_24M_INDEX_TABLE
,
RATE_36M_INDEX_TABLE
,
RATE_48M_INDEX_TABLE
,
RATE_54M_INDEX_TABLE
,
RATE_1M_INDEX_TABLE
,
RATE_2M_INDEX_TABLE
,
RATE_5M_INDEX_TABLE
,
RATE_11M_INDEX_TABLE
,
RATE_INVM_INDEX_TABLE
=
RATE_INVM_INDEX
-
1
,
};
enum
{
IL_FIRST_OFDM_RATE
=
IL_
RATE_6M_INDEX
,
IL39_LAST_OFDM_RATE
=
IL_
RATE_54M_INDEX
,
IL_LAST_OFDM_RATE
=
IL_
RATE_60M_INDEX
,
IL_FIRST_CCK_RATE
=
IL_
RATE_1M_INDEX
,
IL_LAST_CCK_RATE
=
IL_
RATE_11M_INDEX
,
IL_FIRST_OFDM_RATE
=
RATE_6M_INDEX
,
IL39_LAST_OFDM_RATE
=
RATE_54M_INDEX
,
IL_LAST_OFDM_RATE
=
RATE_60M_INDEX
,
IL_FIRST_CCK_RATE
=
RATE_1M_INDEX
,
IL_LAST_CCK_RATE
=
RATE_11M_INDEX
,
};
/* #define vs. enum to keep from defaulting to 'large integer' */
#define
IL_RATE_6M_MASK (1 << IL_
RATE_6M_INDEX)
#define
IL_RATE_9M_MASK (1 << IL_
RATE_9M_INDEX)
#define
IL_RATE_12M_MASK (1 << IL_
RATE_12M_INDEX)
#define
IL_RATE_18M_MASK (1 << IL_
RATE_18M_INDEX)
#define
IL_RATE_24M_MASK (1 << IL_
RATE_24M_INDEX)
#define
IL_RATE_36M_MASK (1 << IL_
RATE_36M_INDEX)
#define
IL_RATE_48M_MASK (1 << IL_
RATE_48M_INDEX)
#define
IL_RATE_54M_MASK (1 << IL_
RATE_54M_INDEX)
#define
IL_RATE_60M_MASK (1 << IL_
RATE_60M_INDEX)
#define
IL_RATE_1M_MASK (1 << IL_
RATE_1M_INDEX)
#define
IL_RATE_2M_MASK (1 << IL_
RATE_2M_INDEX)
#define
IL_RATE_5M_MASK (1 << IL_
RATE_5M_INDEX)
#define
IL_RATE_11M_MASK (1 << IL_
RATE_11M_INDEX)
#define
RATE_6M_MASK (1 <<
RATE_6M_INDEX)
#define
RATE_9M_MASK (1 <<
RATE_9M_INDEX)
#define
RATE_12M_MASK (1 <<
RATE_12M_INDEX)
#define
RATE_18M_MASK (1 <<
RATE_18M_INDEX)
#define
RATE_24M_MASK (1 <<
RATE_24M_INDEX)
#define
RATE_36M_MASK (1 <<
RATE_36M_INDEX)
#define
RATE_48M_MASK (1 <<
RATE_48M_INDEX)
#define
RATE_54M_MASK (1 <<
RATE_54M_INDEX)
#define
RATE_60M_MASK (1 <<
RATE_60M_INDEX)
#define
RATE_1M_MASK (1 <<
RATE_1M_INDEX)
#define
RATE_2M_MASK (1 <<
RATE_2M_INDEX)
#define
RATE_5M_MASK (1 <<
RATE_5M_INDEX)
#define
RATE_11M_MASK (1 <<
RATE_11M_INDEX)
/* uCode API values for legacy bit rates, both OFDM and CCK */
enum
{
IL_
RATE_6M_PLCP
=
13
,
IL_
RATE_9M_PLCP
=
15
,
IL_
RATE_12M_PLCP
=
5
,
IL_
RATE_18M_PLCP
=
7
,
IL_
RATE_24M_PLCP
=
9
,
IL_
RATE_36M_PLCP
=
11
,
IL_
RATE_48M_PLCP
=
1
,
IL_
RATE_54M_PLCP
=
3
,
IL_
RATE_60M_PLCP
=
3
,
/*FIXME:RS:should be removed*/
IL_
RATE_1M_PLCP
=
10
,
IL_
RATE_2M_PLCP
=
20
,
IL_
RATE_5M_PLCP
=
55
,
IL_
RATE_11M_PLCP
=
110
,
/*FIXME:RS:add
IL_
RATE_LEGACY_INVM_PLCP = 0,*/
RATE_6M_PLCP
=
13
,
RATE_9M_PLCP
=
15
,
RATE_12M_PLCP
=
5
,
RATE_18M_PLCP
=
7
,
RATE_24M_PLCP
=
9
,
RATE_36M_PLCP
=
11
,
RATE_48M_PLCP
=
1
,
RATE_54M_PLCP
=
3
,
RATE_60M_PLCP
=
3
,
/*FIXME:RS:should be removed*/
RATE_1M_PLCP
=
10
,
RATE_2M_PLCP
=
20
,
RATE_5M_PLCP
=
55
,
RATE_11M_PLCP
=
110
,
/*FIXME:RS:add RATE_LEGACY_INVM_PLCP = 0,*/
};
/* uCode API values for OFDM high-throughput (HT) bit rates */
enum
{
IL_
RATE_SISO_6M_PLCP
=
0
,
IL_
RATE_SISO_12M_PLCP
=
1
,
IL_
RATE_SISO_18M_PLCP
=
2
,
IL_
RATE_SISO_24M_PLCP
=
3
,
IL_
RATE_SISO_36M_PLCP
=
4
,
IL_
RATE_SISO_48M_PLCP
=
5
,
IL_
RATE_SISO_54M_PLCP
=
6
,
IL_
RATE_SISO_60M_PLCP
=
7
,
IL_
RATE_MIMO2_6M_PLCP
=
0x8
,
IL_
RATE_MIMO2_12M_PLCP
=
0x9
,
IL_
RATE_MIMO2_18M_PLCP
=
0xa
,
IL_
RATE_MIMO2_24M_PLCP
=
0xb
,
IL_
RATE_MIMO2_36M_PLCP
=
0xc
,
IL_
RATE_MIMO2_48M_PLCP
=
0xd
,
IL_
RATE_MIMO2_54M_PLCP
=
0xe
,
IL_
RATE_MIMO2_60M_PLCP
=
0xf
,
IL_
RATE_SISO_INVM_PLCP
,
IL_RATE_MIMO2_INVM_PLCP
=
IL_
RATE_SISO_INVM_PLCP
,
RATE_SISO_6M_PLCP
=
0
,
RATE_SISO_12M_PLCP
=
1
,
RATE_SISO_18M_PLCP
=
2
,
RATE_SISO_24M_PLCP
=
3
,
RATE_SISO_36M_PLCP
=
4
,
RATE_SISO_48M_PLCP
=
5
,
RATE_SISO_54M_PLCP
=
6
,
RATE_SISO_60M_PLCP
=
7
,
RATE_MIMO2_6M_PLCP
=
0x8
,
RATE_MIMO2_12M_PLCP
=
0x9
,
RATE_MIMO2_18M_PLCP
=
0xa
,
RATE_MIMO2_24M_PLCP
=
0xb
,
RATE_MIMO2_36M_PLCP
=
0xc
,
RATE_MIMO2_48M_PLCP
=
0xd
,
RATE_MIMO2_54M_PLCP
=
0xe
,
RATE_MIMO2_60M_PLCP
=
0xf
,
RATE_SISO_INVM_PLCP
,
RATE_MIMO2_INVM_PLCP
=
RATE_SISO_INVM_PLCP
,
};
/* MAC header values for bit rates */
enum
{
IL_
RATE_6M_IEEE
=
12
,
IL_
RATE_9M_IEEE
=
18
,
IL_
RATE_12M_IEEE
=
24
,
IL_
RATE_18M_IEEE
=
36
,
IL_
RATE_24M_IEEE
=
48
,
IL_
RATE_36M_IEEE
=
72
,
IL_
RATE_48M_IEEE
=
96
,
IL_
RATE_54M_IEEE
=
108
,
IL_
RATE_60M_IEEE
=
120
,
IL_
RATE_1M_IEEE
=
2
,
IL_
RATE_2M_IEEE
=
4
,
IL_
RATE_5M_IEEE
=
11
,
IL_
RATE_11M_IEEE
=
22
,
RATE_6M_IEEE
=
12
,
RATE_9M_IEEE
=
18
,
RATE_12M_IEEE
=
24
,
RATE_18M_IEEE
=
36
,
RATE_24M_IEEE
=
48
,
RATE_36M_IEEE
=
72
,
RATE_48M_IEEE
=
96
,
RATE_54M_IEEE
=
108
,
RATE_60M_IEEE
=
120
,
RATE_1M_IEEE
=
2
,
RATE_2M_IEEE
=
4
,
RATE_5M_IEEE
=
11
,
RATE_11M_IEEE
=
22
,
};
#define IL_CCK_BASIC_RATES_MASK \
(
IL_
RATE_1M_MASK | \
IL_
RATE_2M_MASK)
(RATE_1M_MASK | \
RATE_2M_MASK)
#define IL_CCK_RATES_MASK \
(IL_CCK_BASIC_RATES_MASK | \
IL_
RATE_5M_MASK | \
IL_
RATE_11M_MASK)
RATE_5M_MASK | \
RATE_11M_MASK)
#define IL_OFDM_BASIC_RATES_MASK \
(
IL_
RATE_6M_MASK | \
IL_
RATE_12M_MASK | \
IL_
RATE_24M_MASK)
(RATE_6M_MASK | \
RATE_12M_MASK | \
RATE_24M_MASK)
#define IL_OFDM_RATES_MASK \
(IL_OFDM_BASIC_RATES_MASK | \
IL_
RATE_9M_MASK | \
IL_
RATE_18M_MASK | \
IL_
RATE_36M_MASK | \
IL_
RATE_48M_MASK | \
IL_
RATE_54M_MASK)
RATE_9M_MASK | \
RATE_18M_MASK | \
RATE_36M_MASK | \
RATE_48M_MASK | \
RATE_54M_MASK)
#define IL_BASIC_RATES_MASK \
(IL_OFDM_BASIC_RATES_MASK | \
IL_CCK_BASIC_RATES_MASK)
#define
IL_RATES_MASK ((1 << IL_
RATE_COUNT) - 1)
#define
IL_RATES_MASK_3945 ((1 << IL_
RATE_COUNT_3945) - 1)
#define
RATES_MASK ((1 <<
RATE_COUNT) - 1)
#define
RATES_MASK_3945 ((1 <<
RATE_COUNT_3945) - 1)
#define IL_INVALID_VALUE -1
...
...
@@ -221,10 +221,10 @@ enum {
/* Success ratio (ACKed / attempted tx frames) values (perfect is 128 * 100) */
#define IL_RS_GOOD_RATIO 12800
/* 100% */
#define
IL_
RATE_SCALE_SWITCH 10880
/* 85% */
#define
IL_
RATE_HIGH_TH 10880
/* 85% */
#define
IL_
RATE_INCREASE_TH 6400
/* 50% */
#define
IL_
RATE_DECREASE_TH 1920
/* 15% */
#define RATE_SCALE_SWITCH 10880
/* 85% */
#define RATE_HIGH_TH 10880
/* 85% */
#define RATE_INCREASE_TH 6400
/* 50% */
#define RATE_DECREASE_TH 1920
/* 15% */
/* possible actions when in legacy mode */
#define IL_LEGACY_SWITCH_ANTENNA1 0
...
...
@@ -268,7 +268,7 @@ enum {
#define TID_MAX_TIME_DIFF ((TID_QUEUE_MAX_SIZE - 1) * TID_QUEUE_CELL_SPACING)
#define TIME_WRAP_AROUND(x, y) (((y) > (x)) ? (y) - (x) : (0-(x)) + (y))
extern
const
struct
il_rate_info
il_rates
[
IL_
RATE_COUNT
];
extern
const
struct
il_rate_info
il_rates
[
RATE_COUNT
];
enum
il_table_type
{
LQ_NONE
,
...
...
@@ -331,7 +331,7 @@ struct il_scale_tbl_info {
u8
max_search
;
/* maximun number of tables we can search */
s32
*
expected_tpt
;
/* throughput metrics; expected_tpt_G, etc. */
u32
current_rate
;
/* rate_n_flags, uCode API format */
struct
il_rate_scale_data
win
[
IL_
RATE_COUNT
];
/* rate histories */
struct
il_rate_scale_data
win
[
RATE_COUNT
];
/* rate histories */
};
struct
il_traffic_load
{
...
...
@@ -371,7 +371,7 @@ struct il_lq_sta {
u8
is_dup
;
enum
ieee80211_band
band
;
/* The following are bitmaps of rates;
IL_
RATE_6M_MASK, etc. */
/* The following are bitmaps of rates; RATE_6M_MASK, etc. */
u32
supp_rates
;
u16
active_legacy_rate
;
u16
active_siso_rate
;
...
...
drivers/net/wireless/iwlegacy/iwl-sta.c
浏览文件 @
2eb05816
...
...
@@ -314,7 +314,7 @@ u8 il_prep_station(struct il_priv *il, struct il_rxon_context *ctx,
/* 3945 only */
rate
=
(
il
->
band
==
IEEE80211_BAND_5GHZ
)
?
IL_RATE_6M_PLCP
:
IL_
RATE_1M_PLCP
;
RATE_6M_PLCP
:
RATE_1M_PLCP
;
/* Turn on both antennas for the station... */
station
->
sta
.
rate_n_flags
=
cpu_to_le16
(
rate
|
RATE_MCS_ANT_AB_MSK
);
...
...
drivers/net/wireless/iwlegacy/iwl3945-base.c
浏览文件 @
2eb05816
...
...
@@ -1654,7 +1654,7 @@ static void il3945_init_hw_rates(struct il_priv *il,
{
int
i
;
for
(
i
=
0
;
i
<
IL_
RATE_COUNT_LEGACY
;
i
++
)
{
for
(
i
=
0
;
i
<
RATE_COUNT_LEGACY
;
i
++
)
{
rates
[
i
].
bitrate
=
il3945_rates
[
i
].
ieee
*
5
;
rates
[
i
].
hw_value
=
i
;
/* Rate scaling will work on indexes */
rates
[
i
].
hw_value_short
=
i
;
...
...
@@ -2239,7 +2239,7 @@ static void il3945_alive_start(struct il_priv *il)
ieee80211_wake_queues
(
il
->
hw
);
il
->
active_rate
=
IL_
RATES_MASK_3945
;
il
->
active_rate
=
RATES_MASK_3945
;
il_power_update_mode
(
il
,
true
);
...
...
@@ -2642,11 +2642,11 @@ int il3945_request_scan(struct il_priv *il, struct ieee80211_vif *vif)
switch
(
il
->
scan_band
)
{
case
IEEE80211_BAND_2GHZ
:
scan
->
flags
=
RXON_FLG_BAND_24G_MSK
|
RXON_FLG_AUTO_DETECT_MSK
;
scan
->
tx_cmd
.
rate
=
IL_
RATE_1M_PLCP
;
scan
->
tx_cmd
.
rate
=
RATE_1M_PLCP
;
band
=
IEEE80211_BAND_2GHZ
;
break
;
case
IEEE80211_BAND_5GHZ
:
scan
->
tx_cmd
.
rate
=
IL_
RATE_6M_PLCP
;
scan
->
tx_cmd
.
rate
=
RATE_6M_PLCP
;
band
=
IEEE80211_BAND_5GHZ
;
break
;
default:
...
...
drivers/net/wireless/iwlegacy/iwl4965-base.c
浏览文件 @
2eb05816
...
...
@@ -1757,7 +1757,7 @@ static void il4965_alive_start(struct il_priv *il)
ieee80211_wake_queues
(
il
->
hw
);
il
->
active_rate
=
IL_
RATES_MASK
;
il
->
active_rate
=
RATES_MASK
;
if
(
il_is_associated_ctx
(
ctx
))
{
struct
il_rxon_cmd
*
active_rxon
=
...
...
@@ -2711,7 +2711,7 @@ static void il4965_init_hw_rates(struct il_priv *il,
{
int
i
;
for
(
i
=
0
;
i
<
IL_
RATE_COUNT_LEGACY
;
i
++
)
{
for
(
i
=
0
;
i
<
RATE_COUNT_LEGACY
;
i
++
)
{
rates
[
i
].
bitrate
=
il_rates
[
i
].
ieee
*
5
;
rates
[
i
].
hw_value
=
i
;
/* Rate scaling will work on indexes */
rates
[
i
].
hw_value_short
=
i
;
...
...
@@ -2721,7 +2721,7 @@ static void il4965_init_hw_rates(struct il_priv *il,
* If CCK != 1M then set short preamble rate flag.
*/
rates
[
i
].
flags
|=
(
il_rates
[
i
].
plcp
==
IL_
RATE_1M_PLCP
)
?
(
il_rates
[
i
].
plcp
==
RATE_1M_PLCP
)
?
0
:
IEEE80211_RATE_SHORT_PREAMBLE
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录