Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
6de9f7f2
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
161
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看板
提交
6de9f7f2
编写于
8月 11, 2005
作者:
Z
Zhu Yi
提交者:
James Ketrenos
11月 07, 2005
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix firmware error when setting tx_power.
Signed-off-by:
N
Zhu Yi
<
yi.zhu@intel.com
>
上级
22501c8e
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
55 addition
and
76 deletion
+55
-76
drivers/net/wireless/ipw2200.c
drivers/net/wireless/ipw2200.c
+55
-76
未找到文件。
drivers/net/wireless/ipw2200.c
浏览文件 @
6de9f7f2
...
...
@@ -2084,6 +2084,50 @@ static int ipw_send_tx_power(struct ipw_priv *priv, struct ipw_tx_power *power)
return
0
;
}
static
int
ipw_set_tx_power
(
struct
ipw_priv
*
priv
)
{
const
struct
ieee80211_geo
*
geo
=
ieee80211_get_geo
(
priv
->
ieee
);
struct
ipw_tx_power
tx_power
;
s8
max_power
;
int
i
;
memset
(
&
tx_power
,
0
,
sizeof
(
tx_power
));
/* configure device for 'G' band */
tx_power
.
ieee_mode
=
IPW_G_MODE
;
tx_power
.
num_channels
=
geo
->
bg_channels
;
for
(
i
=
0
;
i
<
geo
->
bg_channels
;
i
++
)
{
max_power
=
geo
->
bg
[
i
].
max_power
;
tx_power
.
channels_tx_power
[
i
].
channel_number
=
geo
->
bg
[
i
].
channel
;
tx_power
.
channels_tx_power
[
i
].
tx_power
=
max_power
?
min
(
max_power
,
priv
->
tx_power
)
:
priv
->
tx_power
;
}
if
(
ipw_send_tx_power
(
priv
,
&
tx_power
))
return
-
EIO
;
/* configure device to also handle 'B' band */
tx_power
.
ieee_mode
=
IPW_B_MODE
;
if
(
ipw_send_tx_power
(
priv
,
&
tx_power
))
return
-
EIO
;
/* configure device to also handle 'A' band */
if
(
priv
->
ieee
->
abg_true
)
{
tx_power
.
ieee_mode
=
IPW_A_MODE
;
tx_power
.
num_channels
=
geo
->
a_channels
;
for
(
i
=
0
;
i
<
tx_power
.
num_channels
;
i
++
)
{
max_power
=
geo
->
a
[
i
].
max_power
;
tx_power
.
channels_tx_power
[
i
].
channel_number
=
geo
->
a
[
i
].
channel
;
tx_power
.
channels_tx_power
[
i
].
tx_power
=
max_power
?
min
(
max_power
,
priv
->
tx_power
)
:
priv
->
tx_power
;
}
if
(
ipw_send_tx_power
(
priv
,
&
tx_power
))
return
-
EIO
;
}
return
0
;
}
static
int
ipw_send_rts_threshold
(
struct
ipw_priv
*
priv
,
u16
rts
)
{
struct
ipw_rts_threshold
rts_threshold
=
{
...
...
@@ -8869,79 +8913,33 @@ static int ipw_wx_set_txpow(struct net_device *dev,
union
iwreq_data
*
wrqu
,
char
*
extra
)
{
struct
ipw_priv
*
priv
=
ieee80211_priv
(
dev
);
const
struct
ieee80211_geo
*
geo
=
ieee80211_get_geo
(
priv
->
ieee
);
struct
ipw_tx_power
tx_power
;
int
i
;
int
err
=
0
;
down
(
&
priv
->
sem
);
if
(
ipw_radio_kill_sw
(
priv
,
wrqu
->
power
.
disabled
))
{
up
(
&
priv
->
sem
)
;
return
-
EINPROGRESS
;
err
=
-
EINPROGRESS
;
goto
out
;
}
if
(
!
wrqu
->
power
.
fixed
)
wrqu
->
power
.
value
=
IPW_TX_POWER_DEFAULT
;
if
(
wrqu
->
power
.
flags
!=
IW_TXPOW_DBM
)
{
up
(
&
priv
->
sem
)
;
return
-
EINVAL
;
err
=
-
EINVAL
;
goto
out
;
}
if
((
wrqu
->
power
.
value
>
IPW_TX_POWER_MAX
)
||
(
wrqu
->
power
.
value
<
IPW_TX_POWER_MIN
))
{
up
(
&
priv
->
sem
)
;
return
-
EINVAL
;
err
=
-
EINVAL
;
goto
out
;
}
priv
->
tx_power
=
wrqu
->
power
.
value
;
memset
(
&
tx_power
,
0
,
sizeof
(
tx_power
));
/* configure device for 'G' band */
tx_power
.
ieee_mode
=
IPW_G_MODE
;
tx_power
.
num_channels
=
geo
->
bg_channels
;
for
(
i
=
0
;
i
<
geo
->
bg_channels
;
i
++
)
{
int
max_power
=
geo
->
bg
[
i
].
max_power
;
tx_power
.
channels_tx_power
[
i
].
channel_number
=
i
+
1
;
if
(
max_power
!=
0
&&
priv
->
tx_power
>
max_power
)
tx_power
.
channels_tx_power
[
i
].
tx_power
=
max_power
;
else
tx_power
.
channels_tx_power
[
i
].
tx_power
=
priv
->
tx_power
;
}
if
(
ipw_send_tx_power
(
priv
,
&
tx_power
))
goto
error
;
/* configure device to also handle 'B' band */
tx_power
.
ieee_mode
=
IPW_B_MODE
;
if
(
ipw_send_tx_power
(
priv
,
&
tx_power
))
goto
error
;
/* configure device to also handle 'A' band */
if
(
priv
->
ieee
->
abg_true
)
{
tx_power
.
ieee_mode
=
IPW_A_MODE
;
tx_power
.
num_channels
=
geo
->
a_channels
;
for
(
i
=
0
;
i
<
geo
->
a_channels
;
i
++
)
{
int
max_power
=
geo
->
a
[
i
].
max_power
;
tx_power
.
channels_tx_power
[
i
].
channel_number
=
i
+
1
;
if
(
max_power
!=
0
&&
priv
->
tx_power
>
max_power
)
tx_power
.
channels_tx_power
[
i
].
tx_power
=
max_power
;
else
tx_power
.
channels_tx_power
[
i
].
tx_power
=
priv
->
tx_power
;
}
if
(
ipw_send_tx_power
(
priv
,
&
tx_power
))
goto
error
;
}
up
(
&
priv
->
sem
);
return
0
;
error:
err
=
ipw_set_tx_power
(
priv
);
out:
up
(
&
priv
->
sem
);
return
-
EIO
;
return
err
;
}
static
int
ipw_wx_get_txpow
(
struct
net_device
*
dev
,
...
...
@@ -10426,29 +10424,10 @@ static int init_supported_rates(struct ipw_priv *priv,
static
int
ipw_config
(
struct
ipw_priv
*
priv
)
{
int
i
;
struct
ipw_tx_power
tx_power
;
memset
(
&
priv
->
sys_config
,
0
,
sizeof
(
priv
->
sys_config
));
memset
(
&
tx_power
,
0
,
sizeof
(
tx_power
));
/* This is only called from ipw_up, which resets/reloads the firmware
so, we don't need to first disable the card before we configure
it */
/* configure device for 'G' band */
tx_power
.
ieee_mode
=
IPW_G_MODE
;
tx_power
.
num_channels
=
11
;
for
(
i
=
0
;
i
<
11
;
i
++
)
{
tx_power
.
channels_tx_power
[
i
].
channel_number
=
i
+
1
;
tx_power
.
channels_tx_power
[
i
].
tx_power
=
priv
->
tx_power
;
}
if
(
ipw_send_tx_power
(
priv
,
&
tx_power
))
goto
error
;
/* configure device to also handle 'B' band */
tx_power
.
ieee_mode
=
IPW_B_MODE
;
if
(
ipw_send_tx_power
(
priv
,
&
tx_power
))
if
(
ipw_set_tx_power
(
priv
))
goto
error
;
/* initialize adapter address */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录