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
37859a75
Commit
37859a75
authored
Mar 20, 2013
by
Rafał Miłecki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
b43: N-PHY: use more friendly variables names in RSSI code
Signed-off-by:
Rafał Miłecki
<
zajec5@gmail.com
>
parent
e5ab1fd7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
28 deletions
+36
-28
drivers/net/wireless/b43/phy_n.c
drivers/net/wireless/b43/phy_n.c
+36
-28
No files found.
drivers/net/wireless/b43/phy_n.c
View file @
37859a75
...
...
@@ -1590,7 +1590,7 @@ static void b43_nphy_rev3_rssi_cal(struct b43_wldev *dev)
u16
r
;
/* routing */
u8
rx_core_state
;
u8
core
,
i
,
j
;
int
core
,
i
,
j
,
vcm
;
class
=
b43_nphy_classifier
(
dev
,
0
,
0
);
b43_nphy_classifier
(
dev
,
7
,
4
);
...
...
@@ -1624,33 +1624,40 @@ static void b43_nphy_rev3_rssi_cal(struct b43_wldev *dev)
r
=
core
?
B2056_RX1
:
B2056_RX0
;
b43_nphy_scale_offset_rssi
(
dev
,
0
,
0
,
core
+
1
,
N_RAIL_I
,
2
);
b43_nphy_scale_offset_rssi
(
dev
,
0
,
0
,
core
+
1
,
N_RAIL_Q
,
2
);
for
(
i
=
0
;
i
<
8
;
i
++
)
{
/* Grab RSSI results for every possible VCM */
for
(
vcm
=
0
;
vcm
<
8
;
vcm
++
)
{
b43_radio_maskset
(
dev
,
r
|
B2056_RX_RSSI_MISC
,
0xE3
,
i
<<
2
);
b43_nphy_poll_rssi
(
dev
,
2
,
results
[
i
],
8
);
vcm
<<
2
);
b43_nphy_poll_rssi
(
dev
,
2
,
results
[
vcm
],
8
);
}
/* Find out which VCM got the best results */
for
(
i
=
0
;
i
<
4
;
i
+=
2
)
{
s32
curr
;
s32
curr
d
;
s32
mind
=
0x100000
;
s32
minpoll
=
249
;
u8
minvcm
=
0
;
if
(
2
*
core
!=
i
)
continue
;
for
(
j
=
0
;
j
<
8
;
j
++
)
{
curr
=
results
[
j
][
i
]
*
results
[
j
][
i
]
+
results
[
j
][
i
+
1
]
*
results
[
j
][
i
];
if
(
curr
<
mind
)
{
mind
=
curr
;
minvcm
=
j
;
for
(
vcm
=
0
;
vcm
<
8
;
vcm
++
)
{
curr
d
=
results
[
vcm
][
i
]
*
results
[
vcm
][
i
]
+
results
[
vcm
][
i
+
1
]
*
results
[
vcm
][
i
];
if
(
curr
d
<
mind
)
{
mind
=
curr
d
;
minvcm
=
vcm
;
}
if
(
results
[
j
][
i
]
<
minpoll
)
minpoll
=
results
[
j
][
i
];
if
(
results
[
vcm
][
i
]
<
minpoll
)
minpoll
=
results
[
vcm
][
i
];
}
vcm_final
=
minvcm
;
results_min
[
i
]
=
minpoll
;
}
/* Select the best VCM */
b43_radio_maskset
(
dev
,
r
|
B2056_RX_RSSI_MISC
,
0xE3
,
vcm_final
<<
2
);
for
(
i
=
0
;
i
<
4
;
i
++
)
{
if
(
core
!=
i
/
2
)
continue
;
...
...
@@ -1667,6 +1674,7 @@ static void b43_nphy_rev3_rssi_cal(struct b43_wldev *dev)
2
);
}
}
for
(
core
=
0
;
core
<
2
;
core
++
)
{
if
(
!
(
rx_core_state
&
(
1
<<
core
)))
continue
;
...
...
@@ -1743,7 +1751,7 @@ static void b43_nphy_rev3_rssi_cal(struct b43_wldev *dev)
/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/RSSICal */
static
void
b43_nphy_rev2_rssi_cal
(
struct
b43_wldev
*
dev
,
u8
type
)
{
int
i
,
j
;
int
i
,
j
,
vcm
;
u8
state
[
4
];
u8
code
,
val
;
u16
class
,
override
;
...
...
@@ -1803,37 +1811,37 @@ static void b43_nphy_rev2_rssi_cal(struct b43_wldev *dev, u8 type)
b43_nphy_scale_offset_rssi
(
dev
,
0
,
0
,
5
,
N_RAIL_I
,
type
);
b43_nphy_scale_offset_rssi
(
dev
,
0
,
0
,
5
,
N_RAIL_Q
,
type
);
for
(
i
=
0
;
i
<
4
;
i
++
)
{
for
(
vcm
=
0
;
vcm
<
4
;
vcm
++
)
{
u8
tmp
[
4
];
for
(
j
=
0
;
j
<
4
;
j
++
)
tmp
[
j
]
=
i
;
tmp
[
j
]
=
vcm
;
if
(
type
!=
1
)
b43_nphy_set_rssi_2055_vcm
(
dev
,
type
,
tmp
);
b43_nphy_poll_rssi
(
dev
,
type
,
results
[
i
],
8
);
b43_nphy_poll_rssi
(
dev
,
type
,
results
[
vcm
],
8
);
if
(
type
<
2
)
for
(
j
=
0
;
j
<
2
;
j
++
)
miniq
[
i
][
j
]
=
min
(
results
[
i
][
2
*
j
],
results
[
i
][
2
*
j
+
1
]);
miniq
[
vcm
][
j
]
=
min
(
results
[
vcm
][
2
*
j
],
results
[
vcm
][
2
*
j
+
1
]);
}
for
(
i
=
0
;
i
<
4
;
i
++
)
{
s32
mind
=
0x100000
;
u8
minvcm
=
0
;
s32
minpoll
=
249
;
s32
curr
;
for
(
j
=
0
;
j
<
4
;
j
++
)
{
s32
curr
d
;
for
(
vcm
=
0
;
vcm
<
4
;
vcm
++
)
{
if
(
type
==
2
)
curr
=
abs
(
results
[
j
][
i
]);
curr
d
=
abs
(
results
[
vcm
][
i
]);
else
curr
=
abs
(
miniq
[
j
][
i
/
2
]
-
code
*
8
);
curr
d
=
abs
(
miniq
[
vcm
][
i
/
2
]
-
code
*
8
);
if
(
curr
<
mind
)
{
mind
=
curr
;
minvcm
=
j
;
if
(
curr
d
<
mind
)
{
mind
=
curr
d
;
minvcm
=
vcm
;
}
if
(
results
[
j
][
i
]
<
minpoll
)
minpoll
=
results
[
j
][
i
];
if
(
results
[
vcm
][
i
]
<
minpoll
)
minpoll
=
results
[
vcm
][
i
];
}
results_min
[
i
]
=
minpoll
;
vcm_final
[
i
]
=
minvcm
;
...
...
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