Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
5b69e69d
K
Kernel
项目概览
openeuler
/
Kernel
大约 1 年 前同步成功
通知
6
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
5b69e69d
编写于
2月 17, 2006
作者:
J
John W. Linville
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'upstream-fixes'
上级
750b50ab
73451379
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
59 addition
and
39 deletion
+59
-39
drivers/net/wireless/atmel.c
drivers/net/wireless/atmel.c
+59
-39
未找到文件。
drivers/net/wireless/atmel.c
浏览文件 @
5b69e69d
...
@@ -1872,7 +1872,7 @@ static int atmel_set_encodeext(struct net_device *dev,
...
@@ -1872,7 +1872,7 @@ static int atmel_set_encodeext(struct net_device *dev,
struct
atmel_private
*
priv
=
netdev_priv
(
dev
);
struct
atmel_private
*
priv
=
netdev_priv
(
dev
);
struct
iw_point
*
encoding
=
&
wrqu
->
encoding
;
struct
iw_point
*
encoding
=
&
wrqu
->
encoding
;
struct
iw_encode_ext
*
ext
=
(
struct
iw_encode_ext
*
)
extra
;
struct
iw_encode_ext
*
ext
=
(
struct
iw_encode_ext
*
)
extra
;
int
idx
,
key_len
;
int
idx
,
key_len
,
alg
=
ext
->
alg
,
set_key
=
1
;
/* Determine and validate the key index */
/* Determine and validate the key index */
idx
=
encoding
->
flags
&
IW_ENCODE_INDEX
;
idx
=
encoding
->
flags
&
IW_ENCODE_INDEX
;
...
@@ -1883,39 +1883,42 @@ static int atmel_set_encodeext(struct net_device *dev,
...
@@ -1883,39 +1883,42 @@ static int atmel_set_encodeext(struct net_device *dev,
}
else
}
else
idx
=
priv
->
default_key
;
idx
=
priv
->
default_key
;
if
((
encoding
->
flags
&
IW_ENCODE_DISABLED
)
||
if
(
encoding
->
flags
&
IW_ENCODE_DISABLED
)
ext
->
alg
==
IW_ENCODE_ALG_NONE
)
{
alg
=
IW_ENCODE_ALG_NONE
;
priv
->
wep_is_on
=
0
;
priv
->
encryption_level
=
0
;
priv
->
pairwise_cipher_suite
=
CIPHER_SUITE_NONE
;
}
if
(
ext
->
ext_flags
&
IW_ENCODE_EXT_SET_TX_KEY
)
if
(
ext
->
ext_flags
&
IW_ENCODE_EXT_SET_TX_KEY
)
{
priv
->
default_key
=
idx
;
priv
->
default_key
=
idx
;
set_key
=
ext
->
key_len
>
0
?
1
:
0
;
}
/* Set the requested key */
if
(
set_key
)
{
switch
(
ext
->
alg
)
{
/* Set the requested key first */
case
IW_ENCODE_ALG_NONE
:
switch
(
alg
)
{
break
;
case
IW_ENCODE_ALG_NONE
:
case
IW_ENCODE_ALG_WEP
:
priv
->
wep_is_on
=
0
;
if
(
ext
->
key_len
>
5
)
{
priv
->
encryption_level
=
0
;
priv
->
wep_key_len
[
idx
]
=
13
;
priv
->
pairwise_cipher_suite
=
CIPHER_SUITE_NONE
;
priv
->
pairwise_cipher_suite
=
CIPHER_SUITE_WEP_128
;
break
;
priv
->
encryption_level
=
2
;
case
IW_ENCODE_ALG_WEP
:
}
else
if
(
ext
->
key_len
>
0
)
{
if
(
ext
->
key_len
>
5
)
{
priv
->
wep_key_len
[
idx
]
=
5
;
priv
->
wep_key_len
[
idx
]
=
13
;
priv
->
pairwise_cipher_suite
=
CIPHER_SUITE_WEP_64
;
priv
->
pairwise_cipher_suite
=
CIPHER_SUITE_WEP_128
;
priv
->
encryption_level
=
1
;
priv
->
encryption_level
=
2
;
}
else
{
}
else
if
(
ext
->
key_len
>
0
)
{
priv
->
wep_key_len
[
idx
]
=
5
;
priv
->
pairwise_cipher_suite
=
CIPHER_SUITE_WEP_64
;
priv
->
encryption_level
=
1
;
}
else
{
return
-
EINVAL
;
}
priv
->
wep_is_on
=
1
;
memset
(
priv
->
wep_keys
[
idx
],
0
,
13
);
key_len
=
min
((
int
)
ext
->
key_len
,
priv
->
wep_key_len
[
idx
]);
memcpy
(
priv
->
wep_keys
[
idx
],
ext
->
key
,
key_len
);
break
;
default:
return
-
EINVAL
;
return
-
EINVAL
;
}
}
priv
->
wep_is_on
=
1
;
memset
(
priv
->
wep_keys
[
idx
],
0
,
13
);
key_len
=
min
((
int
)
ext
->
key_len
,
priv
->
wep_key_len
[
idx
]);
memcpy
(
priv
->
wep_keys
[
idx
],
ext
->
key
,
key_len
);
break
;
default:
return
-
EINVAL
;
}
}
return
-
EINPROGRESS
;
return
-
EINPROGRESS
;
...
@@ -3061,17 +3064,26 @@ static void authenticate(struct atmel_private *priv, u16 frame_len)
...
@@ -3061,17 +3064,26 @@ static void authenticate(struct atmel_private *priv, u16 frame_len)
}
}
if
(
status
==
C80211_MGMT_SC_Success
&&
priv
->
wep_is_on
)
{
if
(
status
==
C80211_MGMT_SC_Success
&&
priv
->
wep_is_on
)
{
int
should_associate
=
0
;
/* WEP */
/* WEP */
if
(
trans_seq_no
!=
priv
->
ExpectedAuthentTransactionSeqNum
)
if
(
trans_seq_no
!=
priv
->
ExpectedAuthentTransactionSeqNum
)
return
;
return
;
if
(
trans_seq_no
==
0x0002
&&
if
(
system
==
C80211_MGMT_AAN_OPENSYSTEM
)
{
auth
->
el_id
==
C80211_MGMT_ElementID_ChallengeText
)
{
if
(
trans_seq_no
==
0x0002
)
{
send_authentication_request
(
priv
,
system
,
auth
->
chall_text
,
auth
->
chall_text_len
);
should_associate
=
1
;
return
;
}
}
else
if
(
system
==
C80211_MGMT_AAN_SHAREDKEY
)
{
if
(
trans_seq_no
==
0x0002
&&
auth
->
el_id
==
C80211_MGMT_ElementID_ChallengeText
)
{
send_authentication_request
(
priv
,
system
,
auth
->
chall_text
,
auth
->
chall_text_len
);
return
;
}
else
if
(
trans_seq_no
==
0x0004
)
{
should_associate
=
1
;
}
}
}
if
(
trans_seq_no
==
0x0004
)
{
if
(
should_associate
)
{
if
(
priv
->
station_was_associated
)
{
if
(
priv
->
station_was_associated
)
{
atmel_enter_state
(
priv
,
STATION_STATE_REASSOCIATING
);
atmel_enter_state
(
priv
,
STATION_STATE_REASSOCIATING
);
send_association_request
(
priv
,
1
);
send_association_request
(
priv
,
1
);
...
@@ -3084,11 +3096,13 @@ static void authenticate(struct atmel_private *priv, u16 frame_len)
...
@@ -3084,11 +3096,13 @@ static void authenticate(struct atmel_private *priv, u16 frame_len)
}
}
}
}
if
(
status
==
C80211_MGMT_SC_AuthAlgNotSupported
)
{
if
(
status
==
WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG
)
{
/* Do opensystem first, then try sharedkey */
/* Do opensystem first, then try sharedkey */
if
(
system
==
C80211_MGMT_AAN_OPENSYSTEM
)
{
if
(
system
==
WLAN_AUTH_OPEN
)
{
priv
->
CurrentAuthentTransactionSeqNum
=
0x001
;
priv
->
CurrentAuthentTransactionSeqNum
=
0x001
;
send_authentication_request
(
priv
,
C80211_MGMT_AAN_SHAREDKEY
,
NULL
,
0
);
priv
->
exclude_unencrypted
=
1
;
send_authentication_request
(
priv
,
WLAN_AUTH_SHARED_KEY
,
NULL
,
0
);
return
;
}
else
if
(
priv
->
connect_to_any_BSS
)
{
}
else
if
(
priv
->
connect_to_any_BSS
)
{
int
bss_index
;
int
bss_index
;
...
@@ -3439,10 +3453,13 @@ static void atmel_management_timer(u_long a)
...
@@ -3439,10 +3453,13 @@ static void atmel_management_timer(u_long a)
priv
->
AuthenticationRequestRetryCnt
=
0
;
priv
->
AuthenticationRequestRetryCnt
=
0
;
restart_search
(
priv
);
restart_search
(
priv
);
}
else
{
}
else
{
int
auth
=
C80211_MGMT_AAN_OPENSYSTEM
;
priv
->
AuthenticationRequestRetryCnt
++
;
priv
->
AuthenticationRequestRetryCnt
++
;
priv
->
CurrentAuthentTransactionSeqNum
=
0x0001
;
priv
->
CurrentAuthentTransactionSeqNum
=
0x0001
;
mod_timer
(
&
priv
->
management_timer
,
jiffies
+
MGMT_JIFFIES
);
mod_timer
(
&
priv
->
management_timer
,
jiffies
+
MGMT_JIFFIES
);
send_authentication_request
(
priv
,
C80211_MGMT_AAN_OPENSYSTEM
,
NULL
,
0
);
if
(
priv
->
wep_is_on
&&
priv
->
exclude_unencrypted
)
auth
=
C80211_MGMT_AAN_SHAREDKEY
;
send_authentication_request
(
priv
,
auth
,
NULL
,
0
);
}
}
break
;
break
;
...
@@ -3541,12 +3558,15 @@ static void atmel_command_irq(struct atmel_private *priv)
...
@@ -3541,12 +3558,15 @@ static void atmel_command_irq(struct atmel_private *priv)
priv
->
station_was_associated
=
priv
->
station_is_associated
;
priv
->
station_was_associated
=
priv
->
station_is_associated
;
atmel_enter_state
(
priv
,
STATION_STATE_READY
);
atmel_enter_state
(
priv
,
STATION_STATE_READY
);
}
else
{
}
else
{
int
auth
=
C80211_MGMT_AAN_OPENSYSTEM
;
priv
->
AuthenticationRequestRetryCnt
=
0
;
priv
->
AuthenticationRequestRetryCnt
=
0
;
atmel_enter_state
(
priv
,
STATION_STATE_AUTHENTICATING
);
atmel_enter_state
(
priv
,
STATION_STATE_AUTHENTICATING
);
mod_timer
(
&
priv
->
management_timer
,
jiffies
+
MGMT_JIFFIES
);
mod_timer
(
&
priv
->
management_timer
,
jiffies
+
MGMT_JIFFIES
);
priv
->
CurrentAuthentTransactionSeqNum
=
0x0001
;
priv
->
CurrentAuthentTransactionSeqNum
=
0x0001
;
send_authentication_request
(
priv
,
C80211_MGMT_AAN_SHAREDKEY
,
NULL
,
0
);
if
(
priv
->
wep_is_on
&&
priv
->
exclude_unencrypted
)
auth
=
C80211_MGMT_AAN_SHAREDKEY
;
send_authentication_request
(
priv
,
auth
,
NULL
,
0
);
}
}
return
;
return
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录