Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
5b69e69d
Commit
5b69e69d
authored
Feb 17, 2006
by
John W. Linville
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'upstream-fixes'
parents
750b50ab
73451379
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
39 deletions
+59
-39
drivers/net/wireless/atmel.c
drivers/net/wireless/atmel.c
+59
-39
No files found.
drivers/net/wireless/atmel.c
View file @
5b69e69d
...
...
@@ -1872,7 +1872,7 @@ static int atmel_set_encodeext(struct net_device *dev,
struct
atmel_private
*
priv
=
netdev_priv
(
dev
);
struct
iw_point
*
encoding
=
&
wrqu
->
encoding
;
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 */
idx
=
encoding
->
flags
&
IW_ENCODE_INDEX
;
...
...
@@ -1883,39 +1883,42 @@ static int atmel_set_encodeext(struct net_device *dev,
}
else
idx
=
priv
->
default_key
;
if
((
encoding
->
flags
&
IW_ENCODE_DISABLED
)
||
ext
->
alg
==
IW_ENCODE_ALG_NONE
)
{
priv
->
wep_is_on
=
0
;
priv
->
encryption_level
=
0
;
priv
->
pairwise_cipher_suite
=
CIPHER_SUITE_NONE
;
}
if
(
encoding
->
flags
&
IW_ENCODE_DISABLED
)
alg
=
IW_ENCODE_ALG_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
;
set_key
=
ext
->
key_len
>
0
?
1
:
0
;
}
/* Set the requested key */
switch
(
ext
->
alg
)
{
case
IW_ENCODE_ALG_NONE
:
break
;
case
IW_ENCODE_ALG_WEP
:
if
(
ext
->
key_len
>
5
)
{
priv
->
wep_key_len
[
idx
]
=
13
;
priv
->
pairwise_cipher_suite
=
CIPHER_SUITE_WEP_128
;
priv
->
encryption_level
=
2
;
}
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
{
if
(
set_key
)
{
/* Set the requested key first */
switch
(
alg
)
{
case
IW_ENCODE_ALG_NONE
:
priv
->
wep_is_on
=
0
;
priv
->
encryption_level
=
0
;
priv
->
pairwise_cipher_suite
=
CIPHER_SUITE_NONE
;
break
;
case
IW_ENCODE_ALG_WEP
:
if
(
ext
->
key_len
>
5
)
{
priv
->
wep_key_len
[
idx
]
=
13
;
priv
->
pairwise_cipher_suite
=
CIPHER_SUITE_WEP_128
;
priv
->
encryption_level
=
2
;
}
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
;
}
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
;
...
...
@@ -3061,17 +3064,26 @@ static void authenticate(struct atmel_private *priv, u16 frame_len)
}
if
(
status
==
C80211_MGMT_SC_Success
&&
priv
->
wep_is_on
)
{
int
should_associate
=
0
;
/* WEP */
if
(
trans_seq_no
!=
priv
->
ExpectedAuthentTransactionSeqNum
)
return
;
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
;
if
(
system
==
C80211_MGMT_AAN_OPENSYSTEM
)
{
if
(
trans_seq_no
==
0x0002
)
{
should_associate
=
1
;
}
}
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
)
{
atmel_enter_state
(
priv
,
STATION_STATE_REASSOCIATING
);
send_association_request
(
priv
,
1
);
...
...
@@ -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 */
if
(
system
==
C80211_MGMT_AAN_OPENSYSTEM
)
{
if
(
system
==
WLAN_AUTH_OPEN
)
{
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
)
{
int
bss_index
;
...
...
@@ -3439,10 +3453,13 @@ static void atmel_management_timer(u_long a)
priv
->
AuthenticationRequestRetryCnt
=
0
;
restart_search
(
priv
);
}
else
{
int
auth
=
C80211_MGMT_AAN_OPENSYSTEM
;
priv
->
AuthenticationRequestRetryCnt
++
;
priv
->
CurrentAuthentTransactionSeqNum
=
0x0001
;
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
;
...
...
@@ -3541,12 +3558,15 @@ static void atmel_command_irq(struct atmel_private *priv)
priv
->
station_was_associated
=
priv
->
station_is_associated
;
atmel_enter_state
(
priv
,
STATION_STATE_READY
);
}
else
{
int
auth
=
C80211_MGMT_AAN_OPENSYSTEM
;
priv
->
AuthenticationRequestRetryCnt
=
0
;
atmel_enter_state
(
priv
,
STATION_STATE_AUTHENTICATING
);
mod_timer
(
&
priv
->
management_timer
,
jiffies
+
MGMT_JIFFIES
);
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
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment