Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
da2018e4
Commit
da2018e4
authored
Jul 17, 2003
by
Arnaldo Carvalho de Melo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
o wl3501: create iw_default_channel
Also aimed at being moved to the core wireless extensions code.
parent
0c3b1147
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
14 deletions
+28
-14
drivers/net/wireless/wl3501_cs.c
drivers/net/wireless/wl3501_cs.c
+28
-14
No files found.
drivers/net/wireless/wl3501_cs.c
View file @
da2018e4
...
...
@@ -120,47 +120,55 @@ static int wl3501_chan2freq[] = {
static
const
struct
{
int
reg_domain
;
int
min
,
max
;
int
min
,
max
,
deflt
;
}
iw_channel_table
[]
=
{
{
.
reg_domain
=
IW_REG_DOMAIN_FCC
,
.
min
=
1
,
.
max
=
11
,
.
deflt
=
1
,
},
{
.
reg_domain
=
IW_REG_DOMAIN_DOC
,
.
min
=
1
,
.
max
=
11
,
.
deflt
=
1
,
},
{
.
reg_domain
=
IW_REG_DOMAIN_ETSI
,
.
min
=
1
,
.
max
=
13
,
.
deflt
=
1
,
},
{
.
reg_domain
=
IW_REG_DOMAIN_SPAIN
,
.
min
=
10
,
.
max
=
11
,
.
deflt
=
10
,
},
{
.
reg_domain
=
IW_REG_DOMAIN_FRANCE
,
.
min
=
10
,
.
max
=
13
,
.
deflt
=
10
,
},
{
.
reg_domain
=
IW_REG_DOMAIN_MKK
,
.
min
=
14
,
.
max
=
14
,
.
deflt
=
14
,
},
{
.
reg_domain
=
IW_REG_DOMAIN_MKK1
,
.
min
=
1
,
.
max
=
14
,
.
deflt
=
1
,
},
{
.
reg_domain
=
IW_REG_DOMAIN_ISRAEL
,
.
min
=
3
,
.
max
=
9
,
.
deflt
=
9
,
},
};
...
...
@@ -184,6 +192,24 @@ static int iw_valid_channel(int reg_domain, int channel)
return
rc
;
}
/**
* iw_default_channel - get default channel for a regulatory domain
* @reg_comain - regulatory domain
*
* Returns the default channel for a regulatory domain
*/
static
int
iw_default_channel
(
int
reg_domain
)
{
int
i
,
rc
=
1
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
iw_channel_table
);
i
++
)
if
(
reg_domain
==
iw_channel_table
[
i
].
reg_domain
)
{
rc
=
iw_channel_table
[
i
].
deflt
;
break
;
}
return
rc
;
}
/*
* A linked list of "instances" of the wl24 device. Each actual PCMCIA card
* corresponds to one device instance, and is described by one dev_link_t
...
...
@@ -2050,22 +2076,10 @@ static void wl3501_config(dev_link_t *link)
this
->
card_name
[
0
]
=
'\0'
;
this
->
firmware_date
[
0
]
=
'\0'
;
this
->
rssi
=
255
;
this
->
chan
=
iw_default_channel
(
this
->
reg_domain
);
strlcpy
(
this
->
nick
,
"Planet WL3501"
,
sizeof
(
this
->
nick
));
spin_lock_init
(
&
this
->
lock
);
init_waitqueue_head
(
&
this
->
wait
);
switch
(
this
->
reg_domain
)
{
case
IW_REG_DOMAIN_SPAIN
:
case
IW_REG_DOMAIN_FRANCE
:
this
->
chan
=
10
;
break
;
case
IW_REG_DOMAIN_MKK
:
this
->
chan
=
14
;
break
;
default:
this
->
chan
=
1
;
break
;
}
netif_start_queue
(
dev
);
goto
out
;
cs_failed:
...
...
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